home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1996-06-30 | 24.0 KB | [TEXT/CWIE] |
view JSON data
|
view as text
|
open on a Mac
|
open on a PC
This file was processed as: MacBinary
(archive/macBinary).
You can browse this item here: ModuleUtilities.c
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Sun Jun 30 10:56:23 1996, modified Sun Jun 30 10:56:23 1996, creator 'CWIE', type ASCII, 23814 bytes "ModuleUtilities.c" , at 0x5d86 410 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [CWIE] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 11 4d 6f 64 75 6c 65 | 55 74 69 6c 69 74 69 65 |..Module|Utilitie|
|00000010| 73 2e 63 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |s.c.....|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 5d 06 00 | 00 01 9a ad fc 46 17 ad |.....]..|.....F..|
|00000060| fc 46 17 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.F......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 5f 9a 00 00 |........|...._...|
|00000080| 2f 2a 20 20 76 65 72 73 | 69 6f 6e 20 68 69 73 74 |/* vers|ion hist|
|00000090| 6f 72 79 3a 0d 09 32 38 | 2e 36 2e 39 36 3a 09 41 |ory:..28|.6.96:.A|
|000000a0| 64 64 65 64 20 72 6f 75 | 74 69 6e 65 73 20 4d 79 |dded rou|tines My|
|000000b0| 53 65 74 46 72 61 6d 65 | 2c 20 4d 79 53 65 74 54 |SetFrame|, MySetT|
|000000c0| 69 6d 65 72 2c 0d 09 09 | 09 09 4d 79 41 70 70 65 |imer,...|..MyAppe|
|000000d0| 6e 64 44 49 54 4c 2c 20 | 4d 79 53 68 6f 72 74 65 |ndDITL, |MyShorte|
|000000e0| 6e 44 49 54 4c 2c 20 4d | 79 49 6e 76 61 6c 69 64 |nDITL, M|yInvalid|
|000000f0| 61 74 65 49 74 65 6d 0d | 2a 2f 0d 0d 0d 23 69 66 |ateItem.|*/...#if|
|00000100| 6e 64 65 66 20 5f 5f 50 | 52 4f 46 49 54 5f 49 4e |ndef __P|ROFIT_IN|
|00000110| 54 45 52 46 41 43 45 5f | 5f 0d 23 69 6e 63 6c 75 |TERFACE_|_.#inclu|
|00000120| 64 65 20 22 70 72 6f 46 | 69 74 5f 69 6e 74 65 72 |de "proF|it_inter|
|00000130| 66 61 63 65 2e 68 22 0d | 23 65 6e 64 69 66 0d 23 |face.h".|#endif.#|
|00000140| 69 66 6e 64 65 66 20 5f | 5f 4d 4f 44 55 4c 45 5f |ifndef _|_MODULE_|
|00000150| 55 54 49 4c 49 54 49 45 | 53 5f 5f 0d 23 69 6e 63 |UTILITIE|S__.#inc|
|00000160| 6c 75 64 65 20 22 4d 6f | 64 75 6c 65 55 74 69 6c |lude "Mo|duleUtil|
|00000170| 69 74 69 65 73 2e 68 22 | 0d 23 65 6e 64 69 66 0d |ities.h"|.#endif.|
|00000180| 23 69 66 6e 64 65 66 20 | 5f 5f 54 52 41 50 53 5f |#ifndef |__TRAPS_|
|00000190| 5f 0d 23 69 6e 63 6c 75 | 64 65 20 3c 54 72 61 70 |_.#inclu|de <Trap|
|000001a0| 73 2e 68 3e 0d 23 65 6e | 64 69 66 0d 23 69 66 6e |s.h>.#en|dif.#ifn|
|000001b0| 64 65 66 20 5f 5f 53 54 | 52 49 4e 47 5f 53 55 50 |def __ST|RING_SUP|
|000001c0| 50 4f 52 54 5f 5f 0d 23 | 69 6e 63 6c 75 64 65 20 |PORT__.#|include |
|000001d0| 22 53 74 72 69 6e 67 53 | 75 70 70 6f 72 74 2e 68 |"StringS|upport.h|
|000001e0| 22 0d 23 65 6e 64 69 66 | 0d 0d 0d 2f 2f 20 4e 4f |".#endif|...// NO|
|000001f0| 54 45 3a 20 74 68 69 73 | 20 75 6e 69 74 20 75 73 |TE: this| unit us|
|00000200| 65 73 20 73 74 61 74 69 | 63 20 76 61 72 69 61 62 |es stati|c variab|
|00000210| 6c 65 73 21 0d 0d 0d 23 | 64 65 66 69 6e 65 20 6d |les!...#|define m|
|00000220| 61 78 4e 72 49 74 65 6d | 73 49 6e 57 69 6e 64 6f |axNrItem|sInWindo|
|00000230| 77 50 6f 70 75 70 20 35 | 30 20 20 2f 2a 20 6d 61 |wPopup 5|0 /* ma|
|00000240| 78 20 6e 75 6d 62 65 72 | 20 6f 66 20 69 74 65 6d |x number| of item|
|00000250| 73 20 69 6e 20 61 20 77 | 69 6e 64 6f 77 20 70 6f |s in a w|indow po|
|00000260| 70 75 70 20 69 74 65 6d | 20 2a 2f 0d 0d 2f 2f 20 |pup item| */..// |
|00000270| 74 68 65 20 70 75 72 70 | 6f 73 65 20 6f 66 20 74 |the purp|ose of t|
|00000280| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 70 72 61 |he follo|wing pra|
|00000290| 67 6d 61 73 20 69 73 20 | 74 6f 20 64 65 66 69 6e |gmas is |to defin|
|000002a0| 65 20 74 68 65 20 73 79 | 6d 62 6f 6c 20 55 53 45 |e the sy|mbol USE|
|000002b0| 5f 53 41 4e 45 0d 2f 2f | 20 54 68 69 73 20 73 79 |_SANE.//| This sy|
|000002c0| 6d 62 6f 6c 20 69 73 20 | 31 20 69 66 20 6d 61 74 |mbol is |1 if mat|
|000002d0| 68 2e 68 20 69 73 20 74 | 6f 20 62 65 20 75 73 65 |h.h is t|o be use|
|000002e0| 64 2c 20 30 20 69 66 20 | 66 70 2e 68 0d 2f 2f 20 |d, 0 if |fp.h.// |
|000002f0| 44 65 70 65 6e 64 69 6e | 67 20 6f 6e 20 74 68 65 |Dependin|g on the|
|00000300| 20 63 6f 6d 70 69 6c 65 | 72 20 79 6f 75 20 68 61 | compile|r you ha|
|00000310| 76 65 2c 20 79 6f 75 20 | 6d 61 79 20 68 61 76 65 |ve, you |may have|
|00000320| 20 74 6f 20 63 68 61 6e | 67 65 20 69 74 0d 0d 23 | to chan|ge it..#|
|00000330| 69 66 20 64 65 66 69 6e | 65 64 20 54 48 49 4e 4b |if defin|ed THINK|
|00000340| 5f 43 0d 09 23 64 65 66 | 69 6e 65 20 55 53 45 5f |_C..#def|ine USE_|
|00000350| 53 41 4e 45 20 31 0d 23 | 65 6c 73 65 0d 09 23 64 |SANE 1.#|else..#d|
|00000360| 65 66 69 6e 65 20 55 53 | 45 5f 53 41 4e 45 20 30 |efine US|E_SANE 0|
|00000370| 0d 23 65 6e 64 69 66 0d | 0d 23 69 66 20 55 53 45 |.#endif.|.#if USE|
|00000380| 5f 53 41 4e 45 20 0d 09 | 23 69 6e 63 6c 75 64 65 |_SANE ..|#include|
|00000390| 20 3c 6d 61 74 68 2e 68 | 3e 0d 23 65 6c 73 65 0d | <math.h|>.#else.|
|000003a0| 09 23 69 6e 63 6c 75 64 | 65 20 3c 66 70 2e 68 3e |.#includ|e <fp.h>|
|000003b0| 0d 23 65 6e 64 69 66 0d | 0d 0d 0d 74 79 70 65 64 |.#endif.|...typed|
|000003c0| 65 66 20 73 74 72 75 63 | 74 20 57 69 6e 64 6f 77 |ef struc|t Window|
|000003d0| 45 6e 74 72 79 09 09 09 | 2f 2f 20 61 6e 20 65 6e |Entry...|// an en|
|000003e0| 74 72 79 20 69 6e 20 6f | 75 72 20 70 72 69 76 61 |try in o|ur priva|
|000003f0| 74 65 20 77 69 6e 64 6f | 77 20 6c 69 73 74 0d 7b |te windo|w list.{|
|00000400| 0d 09 57 69 6e 64 6f 77 | 50 74 72 09 09 09 77 69 |..Window|Ptr...wi|
|00000410| 6e 64 6f 77 3b 0d 09 57 | 69 6e 64 6f 77 48 61 6e |ndow;..W|indowHan|
|00000420| 64 6c 65 72 09 09 77 69 | 6e 64 6f 77 48 61 6e 64 |dler..wi|ndowHand|
|00000430| 6c 65 72 3b 0d 09 76 6f | 69 64 2a 09 09 09 09 64 |ler;..vo|id*....d|
|00000440| 61 74 61 3b 09 09 09 2f | 2f 20 64 61 74 61 20 74 |ata;.../|/ data t|
|00000450| 6f 20 62 65 20 70 61 73 | 73 65 64 20 74 6f 20 74 |o be pas|sed to t|
|00000460| 68 65 20 65 76 65 6e 74 | 20 68 61 6e 64 6c 65 72 |he event| handler|
|00000470| 0d 09 52 65 63 74 09 09 | 09 09 67 72 6f 77 52 65 |..Rect..|..growRe|
|00000480| 63 74 3b 09 09 2f 2f 20 | 69 66 20 63 61 6e 47 72 |ct;..// |if canGr|
|00000490| 6f 77 3d 3d 74 72 75 65 | 3a 20 63 6f 6e 74 61 69 |ow==true|: contai|
|000004a0| 6e 73 20 6d 69 6e 20 61 | 6e 64 20 6d 61 78 20 73 |ns min a|nd max s|
|000004b0| 69 7a 65 20 6f 66 20 77 | 69 6e 64 6f 77 0d 0d 09 |ize of w|indow...|
|000004c0| 73 74 72 75 63 74 20 57 | 69 6e 64 6f 77 45 6e 74 |struct W|indowEnt|
|000004d0| 72 79 2a 09 6e 65 78 74 | 3b 09 09 09 2f 2f 20 6c |ry*.next|;...// l|
|000004e0| 69 6e 6b 65 64 20 6c 69 | 73 74 0d 0d 7d 57 69 6e |inked li|st..}Win|
|000004f0| 64 6f 77 45 6e 74 72 79 | 3b 0d 0d 0d 73 74 61 74 |dowEntry|;...stat|
|00000500| 69 63 20 57 69 6e 64 6f | 77 45 6e 74 72 79 2a 09 |ic Windo|wEntry*.|
|00000510| 66 69 72 73 74 57 69 6e | 64 6f 77 45 6e 74 72 79 |firstWin|dowEntry|
|00000520| 3d 6e 69 6c 3b 09 09 09 | 2f 2f 20 6f 75 72 20 70 |=nil;...|// our p|
|00000530| 72 69 76 61 74 65 20 6c | 69 73 74 20 6f 66 20 77 |rivate l|ist of w|
|00000540| 69 6e 64 6f 77 73 0d 0d | 0d 0d 74 79 70 65 64 65 |indows..|..typede|
|00000550| 66 20 6c 6f 6e 67 20 57 | 69 6e 64 6f 77 41 72 72 |f long W|indowArr|
|00000560| 61 79 5b 6d 61 78 4e 72 | 49 74 65 6d 73 49 6e 57 |ay[maxNr|ItemsInW|
|00000570| 69 6e 64 6f 77 50 6f 70 | 75 70 5d 3b 09 2f 2f 20 |indowPop|up];.// |
|00000580| 75 73 65 64 20 66 6f 72 | 20 68 6f 6c 64 69 6e 67 |used for| holding|
|00000590| 20 77 69 6e 64 6f 77 20 | 72 65 66 65 72 65 6e 63 | window |referenc|
|000005a0| 65 73 20 69 6e 20 77 69 | 6e 64 6f 77 20 70 6f 70 |es in wi|ndow pop|
|000005b0| 75 70 73 0d 0d 76 6f 69 | 64 20 47 65 74 47 6c 6f |ups..voi|d GetGlo|
|000005c0| 62 61 6c 57 69 6e 64 6f | 77 52 65 63 74 28 57 69 |balWindo|wRect(Wi|
|000005d0| 6e 64 6f 77 50 74 72 20 | 77 69 6e 64 6f 77 2c 20 |ndowPtr |window, |
|000005e0| 52 65 63 74 2a 20 63 6f | 6e 73 74 20 72 29 0d 09 |Rect* co|nst r)..|
|000005f0| 2f 2f 20 72 65 74 75 72 | 6e 73 20 74 68 65 20 77 |// retur|ns the w|
|00000600| 69 6e 64 6f 77 27 73 20 | 72 65 63 74 20 69 6e 20 |indow's |rect in |
|00000610| 67 6c 6f 62 61 6c 20 63 | 6f 6f 72 64 69 6e 61 74 |global c|oordinat|
|00000620| 65 73 0d 7b 09 47 72 61 | 66 50 74 72 09 6f 6c 64 |es.{.Gra|fPtr.old|
|00000630| 50 6f 72 74 3b 0d 09 47 | 65 74 50 6f 72 74 28 26 |Port;..G|etPort(&|
|00000640| 6f 6c 64 50 6f 72 74 29 | 3b 0d 09 53 65 74 50 6f |oldPort)|;..SetPo|
|00000650| 72 74 28 77 69 6e 64 6f | 77 29 3b 0d 09 2a 72 20 |rt(windo|w);..*r |
|00000660| 3d 20 77 69 6e 64 6f 77 | 2d 3e 70 6f 72 74 52 65 |= window|->portRe|
|00000670| 63 74 3b 0d 09 4c 6f 63 | 61 6c 54 6f 47 6c 6f 62 |ct;..Loc|alToGlob|
|00000680| 61 6c 28 28 50 6f 69 6e | 74 2a 29 26 72 2d 3e 74 |al((Poin|t*)&r->t|
|00000690| 6f 70 29 3b 0d 09 4c 6f | 63 61 6c 54 6f 47 6c 6f |op);..Lo|calToGlo|
|000006a0| 62 61 6c 28 28 50 6f 69 | 6e 74 2a 29 26 72 2d 3e |bal((Poi|nt*)&r->|
|000006b0| 62 6f 74 74 6f 6d 29 3b | 0d 09 53 65 74 50 6f 72 |bottom);|..SetPor|
|000006c0| 74 28 6f 6c 64 50 6f 72 | 74 29 3b 0d 7d 0d 0d 73 |t(oldPor|t);.}..s|
|000006d0| 74 61 74 69 63 20 76 6f | 69 64 20 43 65 6e 74 65 |tatic vo|id Cente|
|000006e0| 72 57 69 6e 64 6f 77 28 | 57 69 6e 64 6f 77 50 74 |rWindow(|WindowPt|
|000006f0| 72 20 77 69 6e 64 6f 77 | 29 0d 09 2f 2f 20 63 65 |r window|)..// ce|
|00000700| 6e 74 65 72 73 20 77 69 | 6e 64 6f 77 20 6f 6e 20 |nters wi|ndow on |
|00000710| 6d 61 69 6e 20 73 63 72 | 65 65 6e 0d 7b 0d 09 52 |main scr|een.{..R|
|00000720| 65 63 74 09 09 09 6d 61 | 69 6e 52 65 63 74 20 3d |ect...ma|inRect =|
|00000730| 20 28 2a 2a 47 65 74 4d | 61 69 6e 44 65 76 69 63 | (**GetM|ainDevic|
|00000740| 65 28 29 29 2e 67 64 52 | 65 63 74 3b 09 2f 2f 20 |e()).gdR|ect;.// |
|00000750| 72 65 63 74 61 6e 67 6c | 65 20 6f 66 20 6d 61 69 |rectangl|e of mai|
|00000760| 6e 20 64 65 76 69 63 65 | 0d 09 52 65 63 74 09 09 |n device|..Rect..|
|00000770| 09 72 3b 0d 09 73 68 6f | 72 74 09 09 09 64 68 2c |.r;..sho|rt...dh,|
|00000780| 20 64 76 3b 0d 0d 09 72 | 20 3d 20 77 69 6e 64 6f | dv;...r| = windo|
|00000790| 77 2d 3e 70 6f 72 74 52 | 65 63 74 3b 0d 09 64 68 |w->portR|ect;..dh|
|000007a0| 20 3d 20 6d 61 69 6e 52 | 65 63 74 2e 6c 65 66 74 | = mainR|ect.left|
|000007b0| 20 2b 20 28 6d 61 69 6e | 52 65 63 74 2e 72 69 67 | + (main|Rect.rig|
|000007c0| 68 74 20 2d 20 6d 61 69 | 6e 52 65 63 74 2e 6c 65 |ht - mai|nRect.le|
|000007d0| 66 74 20 2d 20 28 72 2e | 72 69 67 68 74 20 2d 20 |ft - (r.|right - |
|000007e0| 72 2e 6c 65 66 74 29 29 | 20 2f 20 32 3b 0d 09 64 |r.left))| / 2;..d|
|000007f0| 76 20 3d 20 6d 61 69 6e | 52 65 63 74 2e 74 6f 70 |v = main|Rect.top|
|00000800| 20 2b 20 28 6d 61 69 6e | 52 65 63 74 2e 62 6f 74 | + (main|Rect.bot|
|00000810| 74 6f 6d 20 2d 20 6d 61 | 69 6e 52 65 63 74 2e 74 |tom - ma|inRect.t|
|00000820| 6f 70 20 2d 20 28 72 2e | 62 6f 74 74 6f 6d 20 2d |op - (r.|bottom -|
|00000830| 20 72 2e 74 6f 70 29 29 | 20 2f 20 33 3b 0d 09 4d | r.top))| / 3;..M|
|00000840| 6f 76 65 57 69 6e 64 6f | 77 28 77 69 6e 64 6f 77 |oveWindo|w(window|
|00000850| 2c 20 64 68 2c 20 64 76 | 2b 31 34 2c 20 66 61 6c |, dh, dv|+14, fal|
|00000860| 73 65 29 3b 0d 7d 0d 0d | 0d 76 6f 69 64 20 53 65 |se);.}..|.void Se|
|00000870| 74 47 6c 6f 62 61 6c 57 | 69 6e 64 6f 77 52 65 63 |tGlobalW|indowRec|
|00000880| 74 28 57 69 6e 64 6f 77 | 50 74 72 20 77 69 6e 64 |t(Window|Ptr wind|
|00000890| 6f 77 2c 20 52 65 63 74 | 2a 20 63 6f 6e 73 74 20 |ow, Rect|* const |
|000008a0| 72 29 0d 09 2f 2f 20 6d | 6f 76 65 73 20 74 68 65 |r)..// m|oves the|
|000008b0| 20 77 69 6e 64 6f 77 20 | 74 6f 20 74 68 65 20 67 | window |to the g|
|000008c0| 69 76 65 6e 20 67 6c 6f | 62 61 6c 20 63 6f 6f 72 |iven glo|bal coor|
|000008d0| 64 69 6e 61 74 65 73 0d | 09 2f 2f 20 43 65 6e 74 |dinates.|.// Cent|
|000008e0| 65 72 73 20 74 68 65 20 | 77 69 6e 64 6f 77 20 69 |ers the |window i|
|000008f0| 66 20 72 20 3d 20 7b 30 | 2c 30 2c 30 2c 30 7d 20 |f r = {0|,0,0,0} |
|00000900| 6f 72 20 69 66 20 77 69 | 6e 64 6f 77 20 69 73 20 |or if wi|ndow is |
|00000910| 61 74 20 61 20 62 61 64 | 20 70 6f 73 69 74 69 6f |at a bad| positio|
|00000920| 6e 0d 7b 0d 09 69 66 20 | 28 72 2d 3e 6c 65 66 74 |n.{..if |(r->left|
|00000930| 21 3d 30 20 26 26 20 72 | 2d 3e 72 69 67 68 74 21 |!=0 && r|->right!|
|00000940| 3d 30 29 0d 09 7b 0d 09 | 09 52 65 63 74 09 74 69 |=0)..{..|.Rect.ti|
|00000950| 74 6c 65 20 3d 20 2a 72 | 3b 09 09 09 09 2f 2f 20 |tle = *r|;....// |
|00000960| 72 65 63 74 20 65 6e 63 | 6c 6f 73 69 6e 67 20 74 |rect enc|losing t|
|00000970| 68 65 20 77 69 6e 64 6f | 77 27 73 20 74 69 74 6c |he windo|w's titl|
|00000980| 65 0d 0d 09 09 74 69 74 | 6c 65 2e 62 6f 74 74 6f |e....tit|le.botto|
|00000990| 6d 20 3d 20 74 69 74 6c | 65 2e 74 6f 70 3b 0d 09 |m = titl|e.top;..|
|000009a0| 09 74 69 74 6c 65 2e 74 | 6f 70 20 2d 3d 20 31 36 |.title.t|op -= 16|
|000009b0| 3b 0d 09 09 49 6e 73 65 | 74 52 65 63 74 28 26 74 |;...Inse|tRect(&t|
|000009c0| 69 74 6c 65 2c 20 35 2c | 20 33 29 3b 0d 09 09 69 |itle, 5,| 3);...i|
|000009d0| 66 20 28 52 65 63 74 49 | 6e 52 67 6e 28 26 74 69 |f (RectI|nRgn(&ti|
|000009e0| 74 6c 65 2c 20 47 65 74 | 47 72 61 79 52 67 6e 28 |tle, Get|GrayRgn(|
|000009f0| 29 29 29 09 2f 2f 20 69 | 66 20 77 69 6e 64 6f 77 |))).// i|f window|
|00000a00| 20 73 74 69 6c 6c 20 64 | 72 61 67 67 61 62 6c 65 | still d|raggable|
|00000a10| 0d 09 09 7b 09 53 69 7a | 65 57 69 6e 64 6f 77 28 |...{.Siz|eWindow(|
|00000a20| 77 69 6e 64 6f 77 2c 20 | 72 2d 3e 72 69 67 68 74 |window, |r->right|
|00000a30| 2d 72 2d 3e 6c 65 66 74 | 2c 20 72 2d 3e 62 6f 74 |-r->left|, r->bot|
|00000a40| 74 6f 6d 2d 72 2d 3e 74 | 6f 70 2c 20 74 72 75 65 |tom-r->t|op, true|
|00000a50| 29 3b 0d 09 09 09 4d 6f | 76 65 57 69 6e 64 6f 77 |);....Mo|veWindow|
|00000a60| 28 77 69 6e 64 6f 77 2c | 20 72 2d 3e 6c 65 66 74 |(window,| r->left|
|00000a70| 2c 20 72 2d 3e 74 6f 70 | 2c 20 66 61 6c 73 65 29 |, r->top|, false)|
|00000a80| 3b 0d 09 09 7d 0d 09 09 | 65 6c 73 65 20 43 65 6e |;...}...|else Cen|
|00000a90| 74 65 72 57 69 6e 64 6f | 77 28 77 69 6e 64 6f 77 |terWindo|w(window|
|00000aa0| 29 3b 0d 09 7d 0d 09 65 | 6c 73 65 0d 09 09 43 65 |);..}..e|lse...Ce|
|00000ab0| 6e 74 65 72 57 69 6e 64 | 6f 77 28 77 69 6e 64 6f |nterWind|ow(windo|
|00000ac0| 77 29 3b 0d 7d 0d 0d 0d | 76 6f 69 64 20 52 65 67 |w);.}...|void Reg|
|00000ad0| 69 73 74 65 72 57 69 6e | 64 6f 77 28 57 69 6e 64 |isterWin|dow(Wind|
|00000ae0| 6f 77 50 74 72 20 77 69 | 6e 64 6f 77 2c 20 57 69 |owPtr wi|ndow, Wi|
|00000af0| 6e 64 6f 77 48 61 6e 64 | 6c 65 72 20 68 61 6e 64 |ndowHand|ler hand|
|00000b00| 6c 65 72 2c 20 76 6f 69 | 64 2a 20 70 61 72 61 6d |ler, voi|d* param|
|00000b10| 29 0d 09 2f 2f 20 72 65 | 67 69 73 74 65 72 20 61 |)..// re|gister a|
|00000b20| 20 70 72 69 76 61 74 65 | 20 77 69 6e 64 6f 77 20 | private| window |
|00000b30| 6f 66 20 74 68 69 73 20 | 6d 6f 64 75 6c 65 0d 09 |of this |module..|
|00000b40| 2f 2f 20 77 69 6e 64 6f | 77 3a 20 74 68 65 20 77 |// windo|w: the w|
|00000b50| 69 6e 64 6f 77 20 70 74 | 72 20 74 6f 20 69 74 0d |indow pt|r to it.|
|00000b60| 09 2f 2f 20 68 61 6e 64 | 6c 65 72 3a 20 63 61 6c |.// hand|ler: cal|
|00000b70| 6c 65 64 20 66 6f 72 20 | 68 61 6e 64 6c 69 6e 67 |led for |handling|
|00000b80| 20 77 69 6e 64 6f 77 20 | 72 65 6c 61 74 65 64 20 | window |related |
|00000b90| 65 76 65 6e 74 73 2c 20 | 6d 75 73 74 20 61 74 20 |events, |must at |
|00000ba0| 6c 65 61 73 74 20 69 6d | 70 6c 65 6d 65 6e 74 20 |least im|plement |
|00000bb0| 75 70 64 61 74 65 20 65 | 76 65 6e 74 73 0d 09 2f |update e|vents../|
|00000bc0| 2f 20 70 61 72 61 6d 3a | 20 70 61 72 61 6d 65 74 |/ param:| paramet|
|00000bd0| 65 72 20 70 61 73 73 65 | 64 20 65 61 63 68 20 74 |er passe|d each t|
|00000be0| 69 6d 65 20 68 61 6e 64 | 6c 65 72 20 69 73 20 63 |ime hand|ler is c|
|00000bf0| 61 6c 6c 65 64 0d 7b 0d | 09 57 69 6e 64 6f 77 45 |alled.{.|.WindowE|
|00000c00| 6e 74 72 79 2a 2a 09 70 | 3b 0d 09 57 69 6e 64 6f |ntry**.p|;..Windo|
|00000c10| 77 45 6e 74 72 79 2a 09 | 6e 65 77 45 6e 74 72 79 |wEntry*.|newEntry|
|00000c20| 20 3d 20 28 57 69 6e 64 | 6f 77 45 6e 74 72 79 2a | = (Wind|owEntry*|
|00000c30| 29 4e 65 77 50 74 72 43 | 6c 65 61 72 28 73 69 7a |)NewPtrC|lear(siz|
|00000c40| 65 6f 66 28 57 69 6e 64 | 6f 77 45 6e 74 72 79 29 |eof(Wind|owEntry)|
|00000c50| 29 3b 0d 0d 09 69 66 20 | 28 6e 65 77 45 6e 74 72 |);...if |(newEntr|
|00000c60| 79 3d 3d 6e 69 6c 29 20 | 72 65 74 75 72 6e 3b 0d |y==nil) |return;.|
|00000c70| 09 6e 65 77 45 6e 74 72 | 79 2d 3e 77 69 6e 64 6f |.newEntr|y->windo|
|00000c80| 77 20 3d 20 77 69 6e 64 | 6f 77 3b 0d 09 6e 65 77 |w = wind|ow;..new|
|00000c90| 45 6e 74 72 79 2d 3e 77 | 69 6e 64 6f 77 48 61 6e |Entry->w|indowHan|
|00000ca0| 64 6c 65 72 20 3d 20 68 | 61 6e 64 6c 65 72 3b 0d |dler = h|andler;.|
|00000cb0| 09 6e 65 77 45 6e 74 72 | 79 2d 3e 64 61 74 61 20 |.newEntr|y->data |
|00000cc0| 3d 20 70 61 72 61 6d 3b | 0d 09 70 20 3d 20 26 66 |= param;|..p = &f|
|00000cd0| 69 72 73 74 57 69 6e 64 | 6f 77 45 6e 74 72 79 3b |irstWind|owEntry;|
|00000ce0| 0d 0d 09 77 68 69 6c 65 | 20 28 2a 70 20 21 3d 20 |...while| (*p != |
|00000cf0| 6e 69 6c 29 20 70 20 3d | 20 26 28 2a 2a 70 29 2e |nil) p =| &(**p).|
|00000d00| 6e 65 78 74 3b 09 09 09 | 09 2f 2f 20 66 69 6e 64 |next;...|.// find|
|00000d10| 20 65 6e 64 20 6f 66 20 | 6c 69 73 74 0d 09 2a 70 | end of |list..*p|
|00000d20| 20 3d 20 6e 65 77 45 6e | 74 72 79 3b 0d 0d 7d 0d | = newEn|try;..}.|
|00000d30| 0d 0d 76 6f 69 64 20 55 | 6e 72 65 67 69 73 74 65 |..void U|nregiste|
|00000d40| 72 57 69 6e 64 6f 77 28 | 57 69 6e 64 6f 77 50 74 |rWindow(|WindowPt|
|00000d50| 72 20 77 69 6e 64 6f 77 | 29 0d 09 2f 2f 20 75 6e |r window|)..// un|
|00000d60| 72 65 67 69 73 74 65 72 | 20 61 20 70 72 69 76 61 |register| a priva|
|00000d70| 74 65 20 77 69 6e 64 6f | 77 20 70 72 65 76 69 6f |te windo|w previo|
|00000d80| 75 73 6c 79 20 72 65 67 | 69 73 74 65 72 65 64 20 |usly reg|istered |
|00000d90| 62 79 20 52 65 67 69 73 | 74 65 72 57 69 6e 64 6f |by Regis|terWindo|
|00000da0| 77 0d 7b 0d 09 57 69 6e | 64 6f 77 45 6e 74 72 79 |w.{..Win|dowEntry|
|00000db0| 2a 2a 20 09 70 20 3d 20 | 26 66 69 72 73 74 57 69 |** .p = |&firstWi|
|00000dc0| 6e 64 6f 77 45 6e 74 72 | 79 3b 0d 0d 09 77 68 69 |ndowEntr|y;...whi|
|00000dd0| 6c 65 28 2a 70 20 21 3d | 20 6e 69 6c 29 09 09 09 |le(*p !=| nil)...|
|00000de0| 09 09 09 09 09 2f 2f 20 | 67 6f 20 74 68 72 6f 75 |.....// |go throu|
|00000df0| 67 68 20 77 69 6e 64 6f | 77 20 65 6e 74 72 69 65 |gh windo|w entrie|
|00000e00| 73 0d 09 7b 09 69 66 20 | 28 28 2a 2a 70 29 2e 77 |s..{.if |((**p).w|
|00000e10| 69 6e 64 6f 77 20 3d 3d | 20 77 69 6e 64 6f 77 29 |indow ==| window)|
|00000e20| 09 09 09 09 09 2f 2f 20 | 69 66 20 66 6f 75 6e 64 |.....// |if found|
|00000e30| 0d 09 09 7b 0d 09 09 09 | 57 69 6e 64 6f 77 45 6e |...{....|WindowEn|
|00000e40| 74 72 79 2a 20 09 6e 65 | 78 74 20 3d 20 28 2a 2a |try* .ne|xt = (**|
|00000e50| 70 29 2e 6e 65 78 74 3b | 0d 09 09 0d 09 09 09 44 |p).next;|.......D|
|00000e60| 69 73 70 6f 73 65 50 74 | 72 28 28 50 74 72 29 2a |isposePt|r((Ptr)*|
|00000e70| 70 29 3b 09 09 09 09 09 | 2f 2f 20 72 65 6d 6f 76 |p);.....|// remov|
|00000e80| 65 20 69 74 0d 09 09 09 | 2a 70 20 3d 20 6e 65 78 |e it....|*p = nex|
|00000e90| 74 3b 0d 09 09 09 72 65 | 74 75 72 6e 3b 0d 09 09 |t;....re|turn;...|
|00000ea0| 7d 0d 09 09 70 20 3d 20 | 26 28 2a 2a 70 29 2e 6e |}...p = |&(**p).n|
|00000eb0| 65 78 74 3b 0d 09 7d 2f | 2f 77 68 69 6c 65 0d 7d |ext;..}/|/while.}|
|00000ec0| 0d 0d 73 74 61 74 69 63 | 20 57 69 6e 64 6f 77 45 |..static| WindowE|
|00000ed0| 6e 74 72 79 2a 20 46 69 | 6e 64 57 69 6e 64 6f 77 |ntry* Fi|ndWindow|
|00000ee0| 45 6e 74 72 79 28 57 69 | 6e 64 6f 77 50 74 72 20 |Entry(Wi|ndowPtr |
|00000ef0| 77 69 6e 64 6f 77 29 0d | 09 2f 2f 20 67 69 76 65 |window).|.// give|
|00000f00| 6e 20 61 20 77 69 6e 64 | 6f 77 50 74 72 2c 20 72 |n a wind|owPtr, r|
|00000f10| 65 74 75 72 6e 73 20 69 | 74 73 20 77 69 6e 64 6f |eturns i|ts windo|
|00000f20| 77 45 6e 74 72 79 20 6f | 72 20 6e 69 6c 20 69 66 |wEntry o|r nil if|
|00000f30| 20 6e 6f 20 73 75 63 68 | 20 65 6e 74 72 79 0d 7b | no such| entry.{|
|00000f40| 0d 09 57 69 6e 64 6f 77 | 45 6e 74 72 79 2a 20 09 |..Window|Entry* .|
|00000f50| 70 20 3d 20 66 69 72 73 | 74 57 69 6e 64 6f 77 45 |p = firs|tWindowE|
|00000f60| 6e 74 72 79 3b 0d 09 77 | 68 69 6c 65 28 70 20 21 |ntry;..w|hile(p !|
|00000f70| 3d 20 6e 69 6c 29 09 09 | 09 09 09 09 09 09 09 2f |= nil)..|......./|
|00000f80| 2f 20 67 6f 20 74 68 72 | 6f 75 67 68 20 77 69 6e |/ go thr|ough win|
|00000f90| 64 6f 77 20 65 6e 74 72 | 69 65 73 0d 09 7b 09 69 |dow entr|ies..{.i|
|00000fa0| 66 20 28 70 2d 3e 77 69 | 6e 64 6f 77 20 3d 3d 20 |f (p->wi|ndow == |
|00000fb0| 77 69 6e 64 6f 77 29 09 | 09 09 09 09 2f 2f 20 69 |window).|....// i|
|00000fc0| 66 20 66 6f 75 6e 64 0d | 09 09 09 72 65 74 75 72 |f found.|...retur|
|00000fd0| 6e 20 70 3b 0d 09 09 70 | 20 3d 20 70 2d 3e 6e 65 |n p;...p| = p->ne|
|00000fe0| 78 74 3b 0d 09 7d 2f 2f | 77 68 69 6c 65 0d 09 72 |xt;..}//|while..r|
|00000ff0| 65 74 75 72 6e 20 6e 69 | 6c 3b 09 09 09 09 09 09 |eturn ni|l;......|
|00001000| 09 09 09 09 2f 2f 20 69 | 66 20 6e 6f 74 20 66 6f |....// i|f not fo|
|00001010| 75 6e 64 0d 7d 0d 0d 0d | 0d 76 6f 69 64 20 45 76 |und.}...|.void Ev|
|00001020| 65 6e 74 4c 6f 6f 70 28 | 76 6f 69 64 29 0d 09 2f |entLoop(|void)../|
|00001030| 2f 20 47 65 74 73 20 65 | 76 65 6e 74 73 20 61 6e |/ Gets e|vents an|
|00001040| 64 20 68 61 6e 64 6c 65 | 73 20 74 68 65 6d 20 75 |d handle|s them u|
|00001050| 6e 74 69 6c 20 61 20 77 | 69 6e 64 6f 77 20 68 61 |ntil a w|indow ha|
|00001060| 6e 64 6c 65 72 20 72 65 | 74 75 72 6e 73 20 66 61 |ndler re|turns fa|
|00001070| 6c 73 65 0d 7b 0d 09 45 | 76 65 6e 74 52 65 63 6f |lse.{..E|ventReco|
|00001080| 72 64 09 09 65 76 65 6e | 74 3b 0d 09 42 6f 6f 6c |rd..even|t;..Bool|
|00001090| 65 61 6e 09 09 09 64 6f | 6e 65 20 3d 20 66 61 6c |ean...do|ne = fal|
|000010a0| 73 65 3b 0d 09 57 69 6e | 64 6f 77 45 6e 74 72 79 |se;..Win|dowEntry|
|000010b0| 2a 09 65 6e 74 72 79 3b | 0d 0d 09 77 68 69 6c 65 |*.entry;|...while|
|000010c0| 20 28 21 64 6f 6e 65 29 | 0d 09 7b 0d 09 09 57 61 | (!done)|..{...Wa|
|000010d0| 69 74 4e 65 78 74 45 76 | 65 6e 74 28 65 76 65 72 |itNextEv|ent(ever|
|000010e0| 79 45 76 65 6e 74 2d 68 | 69 67 68 4c 65 76 65 6c |yEvent-h|ighLevel|
|000010f0| 45 76 65 6e 74 4d 61 73 | 6b 2c 20 26 65 76 65 6e |EventMas|k, &even|
|00001100| 74 2c 20 31 2c 20 6e 69 | 6c 29 3b 09 0d 09 09 09 |t, 1, ni|l);.....|
|00001110| 2f 2f 20 64 6f 20 6e 6f | 74 20 67 65 74 20 68 69 |// do no|t get hi|
|00001120| 67 68 20 6c 65 76 65 6c | 20 65 76 65 6e 74 73 20 |gh level| events |
|00001130| 62 65 63 61 75 73 65 20 | 44 6f 45 76 65 6e 74 20 |because |DoEvent |
|00001140| 77 69 6c 6c 20 6e 6f 74 | 0d 09 09 09 2f 2f 20 68 |will not|....// h|
|00001150| 61 6e 64 6c 65 20 74 68 | 65 6d 20 77 68 65 6e 20 |andle th|em when |
|00001160| 6e 6f 74 20 69 6e 20 6d | 61 69 6e 20 6c 6f 6f 70 |not in m|ain loop|
|00001170| 0d 0d 09 09 69 66 28 65 | 76 65 6e 74 2e 77 68 61 |....if(e|vent.wha|
|00001180| 74 20 3d 3d 20 61 63 74 | 69 76 61 74 65 45 76 74 |t == act|ivateEvt|
|00001190| 20 7c 7c 20 65 76 65 6e | 74 2e 77 68 61 74 20 3d | || even|t.what =|
|000011a0| 3d 20 75 70 64 61 74 65 | 45 76 74 29 0d 09 09 7b |= update|Evt)...{|
|000011b0| 09 65 6e 74 72 79 20 3d | 20 46 69 6e 64 57 69 6e |.entry =| FindWin|
|000011c0| 64 6f 77 45 6e 74 72 79 | 28 28 57 69 6e 64 6f 77 |dowEntry|((Window|
|000011d0| 50 74 72 29 65 76 65 6e | 74 2e 6d 65 73 73 61 67 |Ptr)even|t.messag|
|000011e0| 65 29 3b 0d 09 09 09 69 | 66 20 28 65 6e 74 72 79 |e);....i|f (entry|
|000011f0| 20 21 3d 20 6e 69 6c 29 | 09 09 09 09 09 09 09 09 | != nil)|........|
|00001200| 09 2f 2f 20 69 66 20 77 | 65 20 68 61 76 65 20 61 |.// if w|e have a|
|00001210| 6e 20 65 76 65 6e 74 20 | 68 61 6e 64 6c 65 72 0d |n event |handler.|
|00001220| 09 09 09 09 28 2a 65 6e | 74 72 79 2d 3e 77 69 6e |....(*en|try->win|
|00001230| 64 6f 77 48 61 6e 64 6c | 65 72 29 28 27 65 76 6e |dowHandl|er)('evn|
|00001240| 74 27 2c 20 26 65 76 65 | 6e 74 2c 20 65 6e 74 72 |t', &eve|nt, entr|
|00001250| 79 2d 3e 64 61 74 61 29 | 3b 09 2f 2f 20 74 68 65 |y->data)|;.// the|
|00001260| 6e 20 63 61 6c 6c 20 69 | 74 2c 20 69 67 6e 6f 72 |n call i|t, ignor|
|00001270| 65 20 69 74 73 20 72 65 | 74 75 72 6e 20 76 61 6c |e its re|turn val|
|00001280| 75 65 0d 09 09 09 65 6c | 73 65 0d 09 09 09 09 48 |ue....el|se.....H|
|00001290| 61 6e 64 6c 65 45 76 65 | 6e 74 28 26 65 76 65 6e |andleEve|nt(&even|
|000012a0| 74 29 3b 09 09 09 09 09 | 09 09 2f 2f 20 65 6c 73 |t);.....|..// els|
|000012b0| 65 20 70 72 6f 20 46 69 | 74 20 73 68 6f 75 6c 64 |e pro Fi|t should|
|000012c0| 20 62 65 20 61 62 6c 65 | 20 74 6f 20 68 61 6e 64 | be able| to hand|
|000012d0| 6c 65 20 69 74 0d 09 09 | 7d 0d 09 09 65 6c 73 65 |le it...|}...else|
|000012e0| 20 69 66 20 28 65 76 65 | 6e 74 2e 77 68 61 74 20 | if (eve|nt.what |
|000012f0| 3d 3d 20 6d 6f 75 73 65 | 44 6f 77 6e 29 09 09 09 |== mouse|Down)...|
|00001300| 09 09 09 2f 2f 20 74 65 | 73 74 20 69 66 20 75 73 |...// te|st if us|
|00001310| 65 72 20 69 73 20 64 72 | 61 67 67 69 6e 67 20 64 |er is dr|agging d|
|00001320| 69 61 6c 6f 67 0d 09 09 | 7b 09 73 68 6f 72 74 20 |ialog...|{.short |
|00001330| 09 09 70 61 72 74 43 6f | 64 65 3b 0d 09 09 09 57 |..partCo|de;....W|
|00001340| 69 6e 64 6f 77 50 74 72 | 09 63 6c 69 63 6b 65 64 |indowPtr|.clicked|
|00001350| 57 69 6e 64 6f 77 3b 0d | 0d 09 09 09 70 61 72 74 |Window;.|....part|
|00001360| 43 6f 64 65 20 3d 20 46 | 69 6e 64 57 69 6e 64 6f |Code = F|indWindo|
|00001370| 77 28 65 76 65 6e 74 2e | 77 68 65 72 65 2c 20 26 |w(event.|where, &|
|00001380| 63 6c 69 63 6b 65 64 57 | 69 6e 64 6f 77 29 3b 0d |clickedW|indow);.|
|00001390| 09 09 09 65 6e 74 72 79 | 20 3d 20 46 69 6e 64 57 |...entry| = FindW|
|000013a0| 69 6e 64 6f 77 45 6e 74 | 72 79 28 63 6c 69 63 6b |indowEnt|ry(click|
|000013b0| 65 64 57 69 6e 64 6f 77 | 29 3b 0d 09 09 09 73 77 |edWindow|);....sw|
|000013c0| 69 74 63 68 28 70 61 72 | 74 43 6f 64 65 29 0d 09 |itch(par|tCode)..|
|000013d0| 09 09 7b 0d 09 09 09 63 | 61 73 65 20 69 6e 44 72 |..{....c|ase inDr|
|000013e0| 61 67 3a 0d 09 09 09 09 | 09 09 69 66 20 28 63 6c |ag:.....|..if (cl|
|000013f0| 69 63 6b 65 64 57 69 6e | 64 6f 77 3d 3d 46 72 6f |ickedWin|dow==Fro|
|00001400| 6e 74 57 69 6e 64 6f 77 | 28 29 29 0d 09 09 09 09 |ntWindow|()).....|
|00001410| 09 09 7b 0d 09 09 09 09 | 09 09 09 52 65 63 74 09 |..{.....|...Rect.|
|00001420| 64 72 61 67 52 65 63 74 | 20 3d 20 28 2a 2a 47 65 |dragRect| = (**Ge|
|00001430| 74 47 72 61 79 52 67 6e | 28 29 29 2e 72 67 6e 42 |tGrayRgn|()).rgnB|
|00001440| 42 6f 78 3b 0d 09 09 09 | 09 09 09 09 44 72 61 67 |Box;....|....Drag|
|00001450| 57 69 6e 64 6f 77 28 63 | 6c 69 63 6b 65 64 57 69 |Window(c|lickedWi|
|00001460| 6e 64 6f 77 2c 20 65 76 | 65 6e 74 2e 77 68 65 72 |ndow, ev|ent.wher|
|00001470| 65 2c 20 26 64 72 61 67 | 52 65 63 74 29 3b 0d 09 |e, &drag|Rect);..|
|00001480| 09 09 09 09 09 7d 0d 09 | 09 09 09 09 09 62 72 65 |.....}..|.....bre|
|00001490| 61 6b 3b 0d 09 09 09 63 | 61 73 65 20 69 6e 53 79 |ak;....c|ase inSy|
|000014a0| 73 57 69 6e 64 6f 77 3a | 0d 09 09 09 09 09 09 53 |sWindow:|.......S|
|000014b0| 79 73 74 65 6d 43 6c 69 | 63 6b 28 26 65 76 65 6e |ystemCli|ck(&even|
|000014c0| 74 2c 20 63 6c 69 63 6b | 65 64 57 69 6e 64 6f 77 |t, click|edWindow|
|000014d0| 29 3b 0d 09 09 09 09 09 | 09 62 72 65 61 6b 3b 0d |);......|.break;.|
|000014e0| 09 09 09 63 61 73 65 20 | 69 6e 4d 65 6e 75 42 61 |...case |inMenuBa|
|000014f0| 72 3a 09 09 09 09 09 09 | 09 09 09 2f 2f 20 6d 61 |r:......|...// ma|
|00001500| 6b 65 20 74 68 65 20 68 | 65 6c 70 20 61 6e 64 20 |ke the h|elp and |
|00001510| 61 70 70 6c 69 63 61 74 | 69 6f 6e 20 6d 65 6e 75 |applicat|ion menu|
|00001520| 20 77 6f 72 6b 0d 09 09 | 09 09 09 7b 09 6c 6f 6e | work...|...{.lon|
|00001530| 67 20 69 74 65 6d 20 3d | 09 4d 65 6e 75 53 65 6c |g item =|.MenuSel|
|00001540| 65 63 74 28 65 76 65 6e | 74 2e 77 68 65 72 65 29 |ect(even|t.where)|
|00001550| 3b 0d 09 09 09 09 09 09 | 65 6e 74 72 79 20 3d 20 |;.......|entry = |
|00001560| 46 69 6e 64 57 69 6e 64 | 6f 77 45 6e 74 72 79 28 |FindWind|owEntry(|
|00001570| 46 72 6f 6e 74 57 69 6e | 64 6f 77 28 29 29 3b 0d |FrontWin|dow());.|
|00001580| 09 09 09 09 09 09 69 66 | 20 28 65 6e 74 72 79 29 |......if| (entry)|
|00001590| 0d 09 09 09 09 09 09 09 | 64 6f 6e 65 20 3d 20 28 |........|done = (|
|000015a0| 2a 65 6e 74 72 79 2d 3e | 77 69 6e 64 6f 77 48 61 |*entry->|windowHa|
|000015b0| 6e 64 6c 65 72 29 28 27 | 6d 65 6e 75 27 2c 20 26 |ndler)('|menu', &|
|000015c0| 69 74 65 6d 2c 20 65 6e | 74 72 79 2d 3e 64 61 74 |item, en|try->dat|
|000015d0| 61 29 3b 0d 09 09 09 09 | 09 09 62 72 65 61 6b 3b |a);.....|..break;|
|000015e0| 0d 09 09 09 09 09 7d 0d | 09 09 09 63 61 73 65 20 |......}.|...case |
|000015f0| 69 6e 47 72 6f 77 3a 0d | 09 09 09 09 09 7b 09 52 |inGrow:.|.....{.R|
|00001600| 65 63 74 20 67 72 6f 77 | 52 65 63 74 3b 0d 09 09 |ect grow|Rect;...|
|00001610| 09 09 09 09 69 66 20 28 | 65 6e 74 72 79 20 26 26 |....if (|entry &&|
|00001620| 20 28 2a 65 6e 74 72 79 | 2d 3e 77 69 6e 64 6f 77 | (*entry|->window|
|00001630| 48 61 6e 64 6c 65 72 29 | 28 27 67 72 77 31 27 2c |Handler)|('grw1',|
|00001640| 20 26 67 72 6f 77 52 65 | 63 74 2c 20 65 6e 74 72 | &growRe|ct, entr|
|00001650| 79 2d 3e 64 61 74 61 29 | 29 0d 09 09 09 09 09 09 |y->data)|).......|
|00001660| 7b 0d 09 09 09 09 09 09 | 09 52 65 63 74 20 09 72 |{.......|.Rect .r|
|00001670| 20 3d 20 28 2a 2a 47 65 | 74 47 72 61 79 52 67 6e | = (**Ge|tGrayRgn|
|00001680| 28 29 29 2e 72 67 6e 42 | 42 6f 78 3b 0d 09 09 09 |()).rgnB|Box;....|
|00001690| 09 09 09 09 6c 6f 6e 67 | 09 77 53 69 7a 65 3b 0d |....long|.wSize;.|
|000016a0| 09 09 09 09 09 09 09 73 | 68 6f 72 74 09 6d 61 78 |.......s|hort.max|
|000016b0| 57 69 64 74 68 20 3d 20 | 72 2e 72 69 67 68 74 20 |Width = |r.right |
|000016c0| 2d 20 72 2e 6c 65 66 74 | 3b 0d 09 09 09 09 09 09 |- r.left|;.......|
|000016d0| 09 73 68 6f 72 74 09 6d | 61 78 48 65 69 67 68 74 |.short.m|axHeight|
|000016e0| 20 3d 20 72 2e 62 6f 74 | 74 6f 6d 20 2d 20 72 2e | = r.bot|tom - r.|
|000016f0| 74 6f 70 20 2d 20 32 34 | 3b 0d 09 09 09 09 09 09 |top - 24|;.......|
|00001700| 09 69 66 20 28 67 72 6f | 77 52 65 63 74 2e 72 69 |.if (gro|wRect.ri|
|00001710| 67 68 74 20 3e 20 6d 61 | 78 57 69 64 74 68 29 20 |ght > ma|xWidth) |
|00001720| 67 72 6f 77 52 65 63 74 | 2e 72 69 67 68 74 20 3d |growRect|.right =|
|00001730| 20 6d 61 78 57 69 64 74 | 68 3b 0d 09 09 09 09 09 | maxWidt|h;......|
|00001740| 09 09 69 66 20 28 67 72 | 6f 77 52 65 63 74 2e 62 |..if (gr|owRect.b|
|00001750| 6f 74 74 6f 6d 20 3e 20 | 6d 61 78 48 65 69 67 68 |ottom > |maxHeigh|
|00001760| 74 29 20 67 72 6f 77 52 | 65 63 74 2e 62 6f 74 74 |t) growR|ect.bott|
|00001770| 6f 6d 20 3d 20 6d 61 78 | 48 65 69 67 68 74 3b 0d |om = max|Height;.|
|00001780| 0d 09 09 09 09 09 09 09 | 77 53 69 7a 65 20 3d 20 |........|wSize = |
|00001790| 47 72 6f 77 57 69 6e 64 | 6f 77 28 63 6c 69 63 6b |GrowWind|ow(click|
|000017a0| 65 64 57 69 6e 64 6f 77 | 2c 20 65 76 65 6e 74 2e |edWindow|, event.|
|000017b0| 77 68 65 72 65 2c 20 26 | 67 72 6f 77 52 65 63 74 |where, &|growRect|
|000017c0| 29 3b 0d 09 09 09 09 09 | 09 09 53 69 7a 65 57 69 |);......|..SizeWi|
|000017d0| 6e 64 6f 77 28 63 6c 69 | 63 6b 65 64 57 69 6e 64 |ndow(cli|ckedWind|
|000017e0| 6f 77 2c 20 77 53 69 7a | 65 20 26 20 30 78 30 30 |ow, wSiz|e & 0x00|
|000017f0| 46 46 46 46 2c 20 28 28 | 75 6e 73 69 67 6e 65 64 |FFFF, ((|unsigned|
|00001800| 20 6c 6f 6e 67 29 20 28 | 77 53 69 7a 65 29 29 20 | long) (|wSize)) |
|00001810| 3e 3e 20 31 36 2c 20 66 | 61 6c 73 65 29 3b 0d 09 |>> 16, f|alse);..|
|00001820| 09 09 09 09 09 09 28 2a | 65 6e 74 72 79 2d 3e 77 |......(*|entry->w|
|00001830| 69 6e 64 6f 77 48 61 6e | 64 6c 65 72 29 28 27 67 |indowHan|dler)('g|
|00001840| 72 77 32 27 2c 20 6e 69 | 6c 2c 20 65 6e 74 72 79 |rw2', ni|l, entry|
|00001850| 2d 3e 64 61 74 61 29 3b | 0d 09 09 09 09 09 09 7d |->data);|.......}|
|00001860| 0d 09 09 09 09 09 09 62 | 72 65 61 6b 3b 0d 09 09 |.......b|reak;...|
|00001870| 09 09 09 7d 0d 09 09 09 | 63 61 73 65 20 69 6e 43 |...}....|case inC|
|00001880| 6f 6e 74 65 6e 74 3a 0d | 09 09 09 09 09 09 69 66 |ontent:.|......if|
|00001890| 20 28 65 6e 74 72 79 20 | 26 26 20 63 6c 69 63 6b | (entry |&& click|
|000018a0| 65 64 57 69 6e 64 6f 77 | 3d 3d 46 72 6f 6e 74 57 |edWindow|==FrontW|
|000018b0| 69 6e 64 6f 77 28 29 29 | 0d 09 09 09 09 09 09 09 |indow())|........|
|000018c0| 64 6f 6e 65 20 3d 20 28 | 2a 65 6e 74 72 79 2d 3e |done = (|*entry->|
|000018d0| 77 69 6e 64 6f 77 48 61 | 6e 64 6c 65 72 29 28 27 |windowHa|ndler)('|
|000018e0| 65 76 6e 74 27 2c 20 26 | 65 76 65 6e 74 2c 20 65 |evnt', &|event, e|
|000018f0| 6e 74 72 79 2d 3e 64 61 | 74 61 29 3b 09 2f 2f 20 |ntry->da|ta);.// |
|00001900| 74 68 65 6e 20 63 61 6c | 6c 20 69 74 2c 20 69 67 |then cal|l it, ig|
|00001910| 6e 6f 72 65 20 69 74 73 | 20 72 65 74 75 72 6e 20 |nore its| return |
|00001920| 76 61 6c 75 65 0d 09 09 | 09 7d 0d 09 09 7d 0d 09 |value...|.}...}..|
|00001930| 09 65 6c 73 65 09 09 09 | 09 09 09 09 09 09 09 09 |.else...|........|
|00001940| 09 09 09 2f 2f 20 61 6c | 6c 20 6f 74 68 65 72 20 |...// al|l other |
|00001950| 65 76 65 6e 74 73 0d 09 | 09 7b 09 57 69 6e 64 6f |events..|.{.Windo|
|00001960| 77 45 6e 74 72 79 2a 20 | 65 6e 74 72 79 20 3d 20 |wEntry* |entry = |
|00001970| 46 69 6e 64 57 69 6e 64 | 6f 77 45 6e 74 72 79 28 |FindWind|owEntry(|
|00001980| 46 72 6f 6e 74 57 69 6e | 64 6f 77 28 29 29 3b 0d |FrontWin|dow());.|
|00001990| 09 09 09 69 66 20 28 65 | 6e 74 72 79 20 21 3d 20 |...if (e|ntry != |
|000019a0| 6e 69 6c 29 09 09 09 09 | 09 09 09 09 09 09 2f 2f |nil)....|......//|
|000019b0| 20 69 66 20 77 65 20 68 | 61 76 65 20 61 6e 20 65 | if we h|ave an e|
|000019c0| 76 65 6e 74 20 68 61 6e | 64 6c 65 72 0d 09 09 09 |vent han|dler....|
|000019d0| 09 09 64 6f 6e 65 20 3d | 20 28 2a 65 6e 74 72 79 |..done =| (*entry|
|000019e0| 2d 3e 77 69 6e 64 6f 77 | 48 61 6e 64 6c 65 72 29 |->window|Handler)|
|000019f0| 28 27 65 76 6e 74 27 2c | 20 26 65 76 65 6e 74 2c |('evnt',| &event,|
|00001a00| 20 65 6e 74 72 79 2d 3e | 64 61 74 61 29 3b 09 2f | entry->|data);./|
|00001a10| 2f 20 74 68 65 6e 20 63 | 61 6c 6c 20 69 74 2c 20 |/ then c|all it, |
|00001a20| 69 67 6e 6f 72 65 20 69 | 74 73 20 72 65 74 75 72 |ignore i|ts retur|
|00001a30| 6e 20 76 61 6c 75 65 0d | 09 09 7d 0d 09 09 49 6e |n value.|..}...In|
|00001a40| 69 74 43 75 72 73 6f 72 | 28 29 3b 0d 09 7d 2f 2f |itCursor|();..}//|
|00001a50| 77 68 69 6c 65 0d 7d 2f | 2f 45 76 65 6e 74 4c 6f |while.}/|/EventLo|
|00001a60| 6f 70 0d 0d 23 70 72 61 | 67 6d 61 20 6d 61 72 6b |op..#pra|gma mark|
|00001a70| 20 2d 0d 0d 0d 73 74 61 | 74 69 63 20 73 68 6f 72 | -...sta|tic shor|
|00001a80| 74 20 4e 75 6d 54 6f 6f | 6c 62 6f 78 54 72 61 70 |t NumToo|lboxTrap|
|00001a90| 73 28 76 6f 69 64 29 0d | 7b 09 69 66 20 28 4e 47 |s(void).|{.if (NG|
|00001aa0| 65 74 54 72 61 70 41 64 | 64 72 65 73 73 28 5f 49 |etTrapAd|dress(_I|
|00001ab0| 6e 69 74 47 72 61 66 2c | 20 54 6f 6f 6c 54 72 61 |nitGraf,| ToolTra|
|00001ac0| 70 29 20 3d 3d 20 4e 47 | 65 74 54 72 61 70 41 64 |p) == NG|etTrapAd|
|00001ad0| 64 72 65 73 73 28 30 78 | 41 41 36 45 2c 20 54 6f |dress(0x|AA6E, To|
|00001ae0| 6f 6c 54 72 61 70 29 29 | 0d 09 09 72 65 74 75 72 |olTrap))|...retur|
|00001af0| 6e 20 30 78 32 30 30 3b | 0d 09 65 6c 73 65 20 72 |n 0x200;|..else r|
|00001b00| 65 74 75 72 6e 20 30 78 | 34 30 30 3b 0d 7d 0d 0d |eturn 0x|400;.}..|
|00001b10| 73 74 61 74 69 63 20 42 | 6f 6f 6c 65 61 6e 20 54 |static B|oolean T|
|00001b20| 72 61 70 41 76 61 69 6c | 61 62 6c 65 28 73 68 6f |rapAvail|able(sho|
|00001b30| 72 74 20 74 68 65 54 72 | 61 70 29 0d 7b 09 54 72 |rt theTr|ap).{.Tr|
|00001b40| 61 70 54 79 70 65 09 74 | 54 79 70 65 3b 0d 0d 09 |apType.t|Type;...|
|00001b50| 74 54 79 70 65 20 3d 20 | 28 28 74 68 65 54 72 61 |tType = |((theTra|
|00001b60| 70 20 26 20 30 78 30 38 | 30 30 29 20 21 3d 20 30 |p & 0x08|00) != 0|
|00001b70| 29 20 3f 20 54 6f 6f 6c | 54 72 61 70 3a 20 4f 53 |) ? Tool|Trap: OS|
|00001b80| 54 72 61 70 3b 0d 09 69 | 66 20 28 74 54 79 70 65 |Trap;..i|f (tType|
|00001b90| 20 3d 3d 20 54 6f 6f 6c | 54 72 61 70 29 0d 09 7b | == Tool|Trap)..{|
|00001ba0| 09 74 68 65 54 72 61 70 | 20 3d 20 74 68 65 54 72 |.theTrap| = theTr|
|00001bb0| 61 70 20 26 20 30 78 30 | 37 46 46 3b 0d 09 09 69 |ap & 0x0|7FF;...i|
|00001bc0| 66 20 28 74 68 65 54 72 | 61 70 20 3e 3d 20 4e 75 |f (theTr|ap >= Nu|
|00001bd0| 6d 54 6f 6f 6c 62 6f 78 | 54 72 61 70 73 28 29 29 |mToolbox|Traps())|
|00001be0| 0d 09 09 09 74 68 65 54 | 72 61 70 20 3d 20 5f 55 |....theT|rap = _U|
|00001bf0| 6e 69 6d 70 6c 65 6d 65 | 6e 74 65 64 3b 0d 09 7d |nimpleme|nted;..}|
|00001c00| 0d 09 72 65 74 75 72 6e | 20 28 4e 47 65 74 54 72 |..return| (NGetTr|
|00001c10| 61 70 41 64 64 72 65 73 | 73 28 74 68 65 54 72 61 |apAddres|s(theTra|
|00001c20| 70 2c 20 74 54 79 70 65 | 29 20 21 3d 20 4e 47 65 |p, tType|) != NGe|
|00001c30| 74 54 72 61 70 41 64 64 | 72 65 73 73 28 5f 55 6e |tTrapAdd|ress(_Un|
|00001c40| 69 6d 70 6c 65 6d 65 6e | 74 65 64 2c 20 54 6f 6f |implemen|ted, Too|
|00001c50| 6c 54 72 61 70 29 29 3b | 0d 7d 0d 0d 0d 0d 23 70 |lTrap));|.}....#p|
|00001c60| 72 61 67 6d 61 20 6d 61 | 72 6b 20 2d 0d 0d 64 6f |ragma ma|rk -..do|
|00001c70| 75 62 6c 65 20 52 6f 75 | 6e 64 44 6f 75 62 6c 65 |uble Rou|ndDouble|
|00001c80| 28 64 6f 75 62 6c 65 20 | 78 29 0d 09 2f 2f 20 72 |(double |x)..// r|
|00001c90| 6f 75 6e 64 73 20 78 20 | 74 6f 20 6e 65 78 74 20 |ounds x |to next |
|00001ca0| 69 6e 74 65 67 65 72 0d | 7b 0d 23 69 66 64 65 66 |integer.|{.#ifdef|
|00001cb0| 20 5f 5f 46 50 5f 5f 0d | 09 72 65 74 75 72 6e 20 | __FP__.|.return |
|00001cc0| 72 69 6e 74 28 78 29 3b | 0d 23 65 6c 73 65 09 09 |rint(x);|.#else..|
|00001cd0| 09 09 09 09 09 2f 2f 20 | 72 69 6e 74 20 6d 61 79 |.....// |rint may|
|00001ce0| 20 6e 6f 74 20 62 65 20 | 61 72 6f 75 6e 64 2c 20 | not be |around, |
|00001cf0| 65 73 70 65 63 69 61 6c | 6c 79 20 66 6f 72 20 66 |especial|ly for f|
|00001d00| 70 75 2d 76 65 72 73 69 | 6f 6e 0d 09 72 65 74 75 |pu-versi|on..retu|
|00001d10| 72 6e 20 66 6c 6f 6f 72 | 28 78 2b 30 2e 35 29 3b |rn floor|(x+0.5);|
|00001d20| 0d 23 65 6e 64 69 66 0d | 7d 0d 0d 0d 52 65 63 74 |.#endif.|}...Rect|
|00001d30| 20 4d 79 47 65 74 49 74 | 65 6d 52 65 63 74 28 44 | MyGetIt|emRect(D|
|00001d40| 69 61 6c 6f 67 44 61 74 | 61 2a 20 64 6c 67 2c 20 |ialogDat|a* dlg, |
|00001d50| 73 68 6f 72 74 20 69 74 | 65 6d 29 0d 09 2f 2f 20 |short it|em)..// |
|00001d60| 72 65 74 75 72 6e 73 20 | 65 6e 63 6c 6f 73 69 6e |returns |enclosin|
|00001d70| 67 20 72 65 63 74 20 6f | 66 20 61 6e 20 69 74 65 |g rect o|f an ite|
|00001d80| 6d 0d 7b 0d 09 52 65 63 | 74 09 72 3b 0d 09 48 61 |m.{..Rec|t.r;..Ha|
|00001d90| 6e 64 6c 65 09 64 75 6d | 6d 79 48 61 6e 64 6c 65 |ndle.dum|myHandle|
|00001da0| 3b 0d 09 73 68 6f 72 74 | 09 64 75 6d 6d 79 49 6e |;..short|.dummyIn|
|00001db0| 74 3b 0d 09 0d 09 47 65 | 74 44 69 61 6c 6f 67 49 |t;....Ge|tDialogI|
|00001dc0| 74 65 6d 28 64 6c 67 2d | 3e 64 69 61 6c 6f 67 2c |tem(dlg-|>dialog,|
|00001dd0| 20 69 74 65 6d 2c 20 26 | 64 75 6d 6d 79 49 6e 74 | item, &|dummyInt|
|00001de0| 2c 20 26 64 75 6d 6d 79 | 48 61 6e 64 6c 65 2c 20 |, &dummy|Handle, |
|00001df0| 26 72 29 3b 0d 09 72 65 | 74 75 72 6e 20 72 3b 0d |&r);..re|turn r;.|
|00001e00| 7d 0d 0d 76 6f 69 64 20 | 4d 79 49 6e 76 61 6c 69 |}..void |MyInvali|
|00001e10| 64 61 74 65 49 74 65 6d | 28 44 69 61 6c 6f 67 44 |dateItem|(DialogD|
|00001e20| 61 74 61 2a 20 64 6c 67 | 2c 20 73 68 6f 72 74 20 |ata* dlg|, short |
|00001e30| 69 74 65 6d 29 0d 7b 0d | 09 52 65 63 74 09 72 20 |item).{.|.Rect.r |
|00001e40| 3d 20 4d 79 47 65 74 49 | 74 65 6d 52 65 63 74 28 |= MyGetI|temRect(|
|00001e50| 64 6c 67 2c 20 69 74 65 | 6d 29 3b 0d 09 47 72 61 |dlg, ite|m);..Gra|
|00001e60| 66 50 74 72 09 6f 6c 64 | 50 6f 72 74 3b 0d 09 47 |fPtr.old|Port;..G|
|00001e70| 65 74 50 6f 72 74 28 26 | 6f 6c 64 50 6f 72 74 29 |etPort(&|oldPort)|
|00001e80| 3b 0d 09 53 65 74 50 6f | 72 74 28 64 6c 67 2d 3e |;..SetPo|rt(dlg->|
|00001e90| 64 69 61 6c 6f 67 29 3b | 0d 09 49 6e 76 61 6c 52 |dialog);|..InvalR|
|00001ea0| 65 63 74 28 26 72 29 3b | 0d 09 53 65 74 50 6f 72 |ect(&r);|..SetPor|
|00001eb0| 74 28 6f 6c 64 50 6f 72 | 74 29 3b 0d 7d 0d 09 0d |t(oldPor|t);.}...|
|00001ec0| 43 6f 6e 74 72 6f 6c 48 | 61 6e 64 6c 65 20 4d 79 |ControlH|andle My|
|00001ed0| 47 65 74 49 74 65 6d 48 | 61 6e 64 6c 65 28 44 69 |GetItemH|andle(Di|
|00001ee0| 61 6c 6f 67 44 61 74 61 | 2a 20 64 6c 67 2c 20 73 |alogData|* dlg, s|
|00001ef0| 68 6f 72 74 20 69 74 65 | 6d 29 0d 09 2f 2f 20 72 |hort ite|m)..// r|
|00001f00| 65 74 75 72 6e 73 20 74 | 68 65 20 63 6f 6e 74 72 |eturns t|he contr|
|00001f10| 6f 6c 20 68 61 6e 64 6c | 65 20 6f 66 20 61 6e 20 |ol handl|e of an |
|00001f20| 69 74 65 6d 0d 7b 0d 09 | 52 65 63 74 09 72 3b 0d |item.{..|Rect.r;.|
|00001f30| 09 48 61 6e 64 6c 65 09 | 72 65 74 76 61 6c 3b 0d |.Handle.|retval;.|
|00001f40| 09 73 68 6f 72 74 09 64 | 75 6d 6d 79 49 6e 74 3b |.short.d|ummyInt;|
|00001f50| 0d 09 0d 09 47 65 74 44 | 69 61 6c 6f 67 49 74 65 |....GetD|ialogIte|
|00001f60| 6d 28 64 6c 67 2d 3e 64 | 69 61 6c 6f 67 2c 20 69 |m(dlg->d|ialog, i|
|00001f70| 74 65 6d 2c 20 26 64 75 | 6d 6d 79 49 6e 74 2c 20 |tem, &du|mmyInt, |
|00001f80| 26 72 65 74 76 61 6c 2c | 20 26 72 29 3b 0d 09 72 |&retval,| &r);..r|
|00001f90| 65 74 75 72 6e 20 28 43 | 6f 6e 74 72 6f 6c 48 61 |eturn (C|ontrolHa|
|00001fa0| 6e 64 6c 65 29 72 65 74 | 76 61 6c 3b 0d 7d 0d 0d |ndle)ret|val;.}..|
|00001fb0| 73 74 61 74 69 63 20 73 | 68 6f 72 74 20 4d 79 47 |static s|hort MyG|
|00001fc0| 65 74 49 74 65 6d 4b 69 | 6e 64 28 44 69 61 6c 6f |etItemKi|nd(Dialo|
|00001fd0| 67 44 61 74 61 2a 20 64 | 6c 67 2c 20 73 68 6f 72 |gData* d|lg, shor|
|00001fe0| 74 20 69 74 65 6d 29 0d | 09 2f 2f 20 72 65 74 75 |t item).|.// retu|
|00001ff0| 72 6e 73 20 74 68 65 20 | 74 79 70 65 20 6f 66 20 |rns the |type of |
|00002000| 61 6e 20 69 74 65 6d 0d | 7b 09 48 61 6e 64 6c 65 |an item.|{.Handle|
|00002010| 09 64 75 6d 6d 79 48 61 | 6e 64 6c 65 3b 0d 09 52 |.dummyHa|ndle;..R|
|00002020| 65 63 74 09 64 75 6d 6d | 79 52 65 63 74 3b 0d 09 |ect.dumm|yRect;..|
|00002030| 73 68 6f 72 74 09 6b 69 | 6e 64 3b 0d 0d 09 47 65 |short.ki|nd;...Ge|
|00002040| 74 44 49 74 65 6d 28 64 | 6c 67 2d 3e 64 69 61 6c |tDItem(d|lg->dial|
|00002050| 6f 67 2c 20 69 74 65 6d | 2c 20 26 6b 69 6e 64 2c |og, item|, &kind,|
|00002060| 20 26 64 75 6d 6d 79 48 | 61 6e 64 6c 65 2c 20 26 | &dummyH|andle, &|
|00002070| 64 75 6d 6d 79 52 65 63 | 74 29 3b 0d 09 72 65 74 |dummyRec|t);..ret|
|00002080| 75 72 6e 20 6b 69 6e 64 | 3b 0d 7d 0d 0d 76 6f 69 |urn kind|;.}..voi|
|00002090| 64 20 4d 79 48 69 6c 69 | 74 65 49 74 65 6d 28 44 |d MyHili|teItem(D|
|000020a0| 69 61 6c 6f 67 44 61 74 | 61 2a 20 64 6c 67 2c 20 |ialogDat|a* dlg, |
|000020b0| 73 68 6f 72 74 20 69 74 | 65 6d 2c 20 73 68 6f 72 |short it|em, shor|
|000020c0| 74 20 76 61 6c 75 65 29 | 0d 09 2f 2f 20 68 69 6c |t value)|..// hil|
|000020d0| 69 74 65 73 20 61 6e 20 | 69 74 65 6d 20 28 76 61 |ites an |item (va|
|000020e0| 6c 75 65 20 3d 3d 20 32 | 35 35 20 66 6f 72 20 64 |lue == 2|55 for d|
|000020f0| 69 73 61 62 6c 69 6e 67 | 29 0d 7b 0d 09 73 68 6f |isabling|).{..sho|
|00002100| 72 74 20 6b 69 6e 64 20 | 3d 20 4d 79 47 65 74 49 |rt kind |= MyGetI|
|00002110| 74 65 6d 4b 69 6e 64 28 | 64 6c 67 2c 20 69 74 65 |temKind(|dlg, ite|
|00002120| 6d 29 20 26 20 30 78 37 | 46 3b 0d 09 69 66 20 28 |m) & 0x7|F;..if (|
|00002130| 6b 69 6e 64 20 3e 3d 20 | 63 74 72 6c 49 74 65 6d |kind >= |ctrlItem|
|00002140| 2b 62 74 6e 43 74 72 6c | 20 26 26 20 6b 69 6e 64 |+btnCtrl| && kind|
|00002150| 20 3c 3d 20 63 74 72 6c | 49 74 65 6d 2b 72 65 73 | <= ctrl|Item+res|
|00002160| 43 74 72 6c 29 0d 09 09 | 48 69 6c 69 74 65 43 6f |Ctrl)...|HiliteCo|
|00002170| 6e 74 72 6f 6c 28 4d 79 | 47 65 74 49 74 65 6d 48 |ntrol(My|GetItemH|
|00002180| 61 6e 64 6c 65 28 64 6c | 67 2c 20 69 74 65 6d 29 |andle(dl|g, item)|
|00002190| 2c 20 76 61 6c 75 65 29 | 3b 0d 7d 09 0d 0d 76 6f |, value)|;.}...vo|
|000021a0| 69 64 20 4d 79 53 68 6f | 77 49 74 65 6d 28 44 69 |id MySho|wItem(Di|
|000021b0| 61 6c 6f 67 44 61 74 61 | 2a 20 64 6c 67 2c 20 73 |alogData|* dlg, s|
|000021c0| 68 6f 72 74 20 69 74 65 | 6d 29 0d 09 2f 2f 20 6d |hort ite|m)..// m|
|000021d0| 61 6b 65 73 20 74 68 65 | 20 67 69 76 65 6e 20 69 |akes the| given i|
|000021e0| 74 65 6d 20 76 69 73 69 | 62 6c 65 0d 7b 0d 09 53 |tem visi|ble.{..S|
|000021f0| 68 6f 77 44 69 61 6c 6f | 67 49 74 65 6d 28 64 6c |howDialo|gItem(dl|
|00002200| 67 2d 3e 64 69 61 6c 6f | 67 2c 20 69 74 65 6d 29 |g->dialo|g, item)|
|00002210| 3b 0d 7d 0d 0d 76 6f 69 | 64 20 4d 79 48 69 64 65 |;.}..voi|d MyHide|
|00002220| 49 74 65 6d 28 44 69 61 | 6c 6f 67 44 61 74 61 2a |Item(Dia|logData*|
|00002230| 20 64 6c 67 2c 20 73 68 | 6f 72 74 20 69 74 65 6d | dlg, sh|ort item|
|00002240| 29 0d 09 2f 2f 20 6d 61 | 6b 65 73 20 74 68 65 20 |)..// ma|kes the |
|00002250| 67 69 76 65 6e 20 69 74 | 65 6d 20 69 6e 76 69 73 |given it|em invis|
|00002260| 69 62 6c 65 0d 7b 0d 09 | 48 69 64 65 44 69 61 6c |ible.{..|HideDial|
|00002270| 6f 67 49 74 65 6d 28 64 | 6c 67 2d 3e 64 69 61 6c |ogItem(d|lg->dial|
|00002280| 6f 67 2c 20 69 74 65 6d | 29 3b 0d 7d 0d 0d 76 6f |og, item|);.}..vo|
|00002290| 69 64 20 4d 79 53 65 74 | 49 74 65 6d 56 61 6c 75 |id MySet|ItemValu|
|000022a0| 65 28 44 69 61 6c 6f 67 | 44 61 74 61 2a 20 64 6c |e(Dialog|Data* dl|
|000022b0| 67 2c 20 73 68 6f 72 74 | 20 69 74 65 6d 2c 20 73 |g, short| item, s|
|000022c0| 68 6f 72 74 20 76 61 6c | 75 65 29 0d 09 2f 2f 20 |hort val|ue)..// |
|000022d0| 73 65 74 73 20 74 68 65 | 20 76 61 6c 75 65 20 6f |sets the| value o|
|000022e0| 66 20 61 20 63 6f 6e 74 | 72 6f 6c 20 61 6e 20 69 |f a cont|rol an i|
|000022f0| 74 65 6d 0d 7b 0d 09 73 | 68 6f 72 74 20 6b 69 6e |tem.{..s|hort kin|
|00002300| 64 20 3d 20 4d 79 47 65 | 74 49 74 65 6d 4b 69 6e |d = MyGe|tItemKin|
|00002310| 64 28 64 6c 67 2c 20 69 | 74 65 6d 29 20 26 20 30 |d(dlg, i|tem) & 0|
|00002320| 78 37 46 3b 0d 09 69 66 | 20 28 6b 69 6e 64 20 3e |x7F;..if| (kind >|
|00002330| 3d 20 63 74 72 6c 49 74 | 65 6d 2b 62 74 6e 43 74 |= ctrlIt|em+btnCt|
|00002340| 72 6c 20 26 26 20 6b 69 | 6e 64 20 3c 3d 20 63 74 |rl && ki|nd <= ct|
|00002350| 72 6c 49 74 65 6d 2b 72 | 65 73 43 74 72 6c 29 0d |rlItem+r|esCtrl).|
|00002360| 09 09 53 65 74 43 6f 6e | 74 72 6f 6c 56 61 6c 75 |..SetCon|trolValu|
|00002370| 65 28 4d 79 47 65 74 49 | 74 65 6d 48 61 6e 64 6c |e(MyGetI|temHandl|
|00002380| 65 28 64 6c 67 2c 20 69 | 74 65 6d 29 2c 20 76 61 |e(dlg, i|tem), va|
|00002390| 6c 75 65 29 3b 0d 7d 0d | 0d 73 68 6f 72 74 20 4d |lue);.}.|.short M|
|000023a0| 79 47 65 74 49 74 65 6d | 56 61 6c 75 65 28 44 69 |yGetItem|Value(Di|
|000023b0| 61 6c 6f 67 44 61 74 61 | 2a 20 64 6c 67 2c 20 73 |alogData|* dlg, s|
|000023c0| 68 6f 72 74 20 69 74 65 | 6d 29 0d 09 2f 2f 20 67 |hort ite|m)..// g|
|000023d0| 65 74 73 20 74 68 65 20 | 76 61 6c 75 65 20 6f 66 |ets the |value of|
|000023e0| 20 61 6e 20 69 74 65 6d | 0d 7b 0d 09 73 68 6f 72 | an item|.{..shor|
|000023f0| 74 20 6b 69 6e 64 20 3d | 20 4d 79 47 65 74 49 74 |t kind =| MyGetIt|
|00002400| 65 6d 4b 69 6e 64 28 64 | 6c 67 2c 20 69 74 65 6d |emKind(d|lg, item|
|00002410| 29 20 26 20 30 78 37 46 | 3b 0d 09 69 66 20 28 6b |) & 0x7F|;..if (k|
|00002420| 69 6e 64 20 3e 3d 20 63 | 74 72 6c 49 74 65 6d 2b |ind >= c|trlItem+|
|00002430| 62 74 6e 43 74 72 6c 20 | 26 26 20 6b 69 6e 64 20 |btnCtrl |&& kind |
|00002440| 3c 3d 20 63 74 72 6c 49 | 74 65 6d 2b 72 65 73 43 |<= ctrlI|tem+resC|
|00002450| 74 72 6c 29 0d 09 09 72 | 65 74 75 72 6e 20 47 65 |trl)...r|eturn Ge|
|00002460| 74 43 6f 6e 74 72 6f 6c | 56 61 6c 75 65 28 4d 79 |tControl|Value(My|
|00002470| 47 65 74 49 74 65 6d 48 | 61 6e 64 6c 65 28 64 6c |GetItemH|andle(dl|
|00002480| 67 2c 20 69 74 65 6d 29 | 29 3b 0d 09 65 6c 73 65 |g, item)|);..else|
|00002490| 0d 09 09 72 65 74 75 72 | 6e 20 30 3b 0d 7d 0d 0d |...retur|n 0;.}..|
|000024a0| 76 6f 69 64 20 4d 79 47 | 65 74 49 74 65 6d 54 65 |void MyG|etItemTe|
|000024b0| 78 74 28 44 69 61 6c 6f | 67 44 61 74 61 2a 20 64 |xt(Dialo|gData* d|
|000024c0| 6c 67 2c 20 73 68 6f 72 | 74 20 69 74 65 6d 2c 20 |lg, shor|t item, |
|000024d0| 53 74 72 32 35 35 20 64 | 65 73 74 29 0d 09 2f 2f |Str255 d|est)..//|
|000024e0| 20 72 65 74 75 72 6e 73 | 20 74 68 65 20 74 65 78 | returns| the tex|
|000024f0| 74 20 69 6e 20 61 6e 20 | 69 74 65 6d 0d 7b 0d 09 |t in an |item.{..|
|00002500| 73 68 6f 72 74 20 6b 69 | 6e 64 20 3d 20 4d 79 47 |short ki|nd = MyG|
|00002510| 65 74 49 74 65 6d 4b 69 | 6e 64 28 64 6c 67 2c 20 |etItemKi|nd(dlg, |
|00002520| 69 74 65 6d 29 20 26 20 | 30 78 37 46 3b 0d 09 69 |item) & |0x7F;..i|
|00002530| 66 20 28 6b 69 6e 64 20 | 3d 3d 20 73 74 61 74 54 |f (kind |== statT|
|00002540| 65 78 74 20 7c 7c 20 6b | 69 6e 64 20 3d 3d 20 65 |ext || k|ind == e|
|00002550| 64 69 74 54 65 78 74 29 | 09 09 09 09 2f 2f 20 69 |ditText)|....// i|
|00002560| 66 20 61 20 74 65 78 74 | 20 69 74 65 6d 0d 09 09 |f a text| item...|
|00002570| 47 65 74 49 54 65 78 74 | 28 28 48 61 6e 64 6c 65 |GetIText|((Handle|
|00002580| 29 4d 79 47 65 74 49 74 | 65 6d 48 61 6e 64 6c 65 |)MyGetIt|emHandle|
|00002590| 28 64 6c 67 2c 20 69 74 | 65 6d 29 2c 20 64 65 73 |(dlg, it|em), des|
|000025a0| 74 29 3b 0d 09 65 6c 73 | 65 20 69 66 20 28 6b 69 |t);..els|e if (ki|
|000025b0| 6e 64 20 3e 3d 20 63 74 | 72 6c 49 74 65 6d 20 26 |nd >= ct|rlItem &|
|000025c0| 26 20 6b 69 6e 64 20 3c | 3d 20 63 74 72 6c 49 74 |& kind <|= ctrlIt|
|000025d0| 65 6d 2b 72 65 73 43 74 | 72 6c 29 09 2f 2f 20 69 |em+resCt|rl).// i|
|000025e0| 66 20 61 20 63 6f 6e 74 | 72 6f 6c 0d 09 09 47 65 |f a cont|rol...Ge|
|000025f0| 74 43 54 69 74 6c 65 28 | 4d 79 47 65 74 49 74 65 |tCTitle(|MyGetIte|
|00002600| 6d 48 61 6e 64 6c 65 28 | 64 6c 67 2c 20 69 74 65 |mHandle(|dlg, ite|
|00002610| 6d 29 2c 20 64 65 73 74 | 29 3b 0d 7d 0d 0d 76 6f |m), dest|);.}..vo|
|00002620| 69 64 20 4d 79 53 65 74 | 49 74 65 6d 54 65 78 74 |id MySet|ItemText|
|00002630| 28 44 69 61 6c 6f 67 44 | 61 74 61 2a 20 64 6c 67 |(DialogD|ata* dlg|
|00002640| 2c 20 73 68 6f 72 74 20 | 69 74 65 6d 2c 20 63 6f |, short |item, co|
|00002650| 6e 73 74 20 53 74 72 32 | 35 35 20 73 29 0d 09 2f |nst Str2|55 s)../|
|00002660| 2f 20 73 65 74 73 20 74 | 68 65 20 74 65 78 74 20 |/ sets t|he text |
|00002670| 6f 66 20 61 6e 20 69 74 | 65 6d 0d 7b 0d 09 73 68 |of an it|em.{..sh|
|00002680| 6f 72 74 20 6b 69 6e 64 | 20 3d 20 4d 79 47 65 74 |ort kind| = MyGet|
|00002690| 49 74 65 6d 4b 69 6e 64 | 28 64 6c 67 2c 20 69 74 |ItemKind|(dlg, it|
|000026a0| 65 6d 29 20 26 20 30 78 | 37 46 3b 0d 0d 09 69 66 |em) & 0x|7F;...if|
|000026b0| 20 28 6b 69 6e 64 20 3d | 3d 20 73 74 61 74 54 65 | (kind =|= statTe|
|000026c0| 78 74 20 7c 7c 20 6b 69 | 6e 64 20 3d 3d 20 65 64 |xt || ki|nd == ed|
|000026d0| 69 74 54 65 78 74 29 09 | 09 09 09 2f 2f 20 69 66 |itText).|...// if|
|000026e0| 20 61 20 74 65 78 74 20 | 69 74 65 6d 0d 09 09 53 | a text |item...S|
|000026f0| 65 74 49 54 65 78 74 28 | 28 48 61 6e 64 6c 65 29 |etIText(|(Handle)|
|00002700| 4d 79 47 65 74 49 74 65 | 6d 48 61 6e 64 6c 65 28 |MyGetIte|mHandle(|
|00002710| 64 6c 67 2c 20 69 74 65 | 6d 29 2c 20 73 29 3b 0d |dlg, ite|m), s);.|
|00002720| 09 65 6c 73 65 20 69 66 | 20 28 6b 69 6e 64 20 3e |.else if| (kind >|
|00002730| 3d 20 63 74 72 6c 49 74 | 65 6d 20 26 26 20 6b 69 |= ctrlIt|em && ki|
|00002740| 6e 64 20 3c 3d 20 63 74 | 72 6c 49 74 65 6d 2b 72 |nd <= ct|rlItem+r|
|00002750| 65 73 43 74 72 6c 29 09 | 2f 2f 20 69 66 20 61 20 |esCtrl).|// if a |
|00002760| 63 6f 6e 74 72 6f 6c 0d | 09 09 53 65 74 43 54 69 |control.|..SetCTi|
|00002770| 74 6c 65 28 4d 79 47 65 | 74 49 74 65 6d 48 61 6e |tle(MyGe|tItemHan|
|00002780| 64 6c 65 28 64 6c 67 2c | 20 69 74 65 6d 29 2c 20 |dle(dlg,| item), |
|00002790| 73 29 3b 0d 7d 0d 0d 76 | 6f 69 64 20 4d 79 53 65 |s);.}..v|oid MySe|
|000027a0| 6c 65 63 74 49 74 65 6d | 54 65 78 74 28 44 69 61 |lectItem|Text(Dia|
|000027b0| 6c 6f 67 44 61 74 61 2a | 20 64 6c 67 2c 20 73 68 |logData*| dlg, sh|
|000027c0| 6f 72 74 20 69 64 2c 20 | 73 68 6f 72 74 20 73 74 |ort id, |short st|
|000027d0| 61 72 74 2c 20 73 68 6f | 72 74 20 65 6e 64 29 0d |art, sho|rt end).|
|000027e0| 09 2f 2f 20 73 65 6c 65 | 63 74 73 20 61 20 74 65 |.// sele|cts a te|
|000027f0| 78 74 20 65 64 69 74 20 | 69 74 65 6d 0d 7b 0d 09 |xt edit |item.{..|
|00002800| 53 65 6c 49 54 65 78 74 | 28 64 6c 67 2d 3e 64 69 |SelIText|(dlg->di|
|00002810| 61 6c 6f 67 2c 20 69 64 | 2c 20 73 74 61 72 74 2c |alog, id|, start,|
|00002820| 20 65 6e 64 29 3b 0d 7d | 0d 0d 76 6f 69 64 20 4d | end);.}|..void M|
|00002830| 79 53 65 74 45 78 74 65 | 6e 64 65 64 49 74 65 6d |ySetExte|ndedItem|
|00002840| 28 44 69 61 6c 6f 67 44 | 61 74 61 2a 20 64 6c 67 |(DialogD|ata* dlg|
|00002850| 2c 20 73 68 6f 72 74 20 | 69 64 2c 20 64 6f 75 62 |, short |id, doub|
|00002860| 6c 65 20 76 61 6c 29 0d | 09 2f 2f 20 73 65 74 73 |le val).|.// sets|
|00002870| 20 61 20 74 65 78 74 20 | 69 74 65 6d 20 74 6f 20 | a text |item to |
|00002880| 61 20 66 6c 6f 61 74 69 | 6e 67 20 70 6f 69 6e 74 |a floati|ng point|
|00002890| 20 6e 75 6d 62 65 72 0d | 7b 09 53 74 72 32 35 35 | number.|{.Str255|
|000028a0| 09 73 3b 0d 0d 09 4e 75 | 6d 62 65 72 54 6f 53 74 |.s;...Nu|mberToSt|
|000028b0| 72 32 35 35 28 76 61 6c | 2c 20 73 2c 20 31 2c 20 |r255(val|, s, 1, |
|000028c0| 37 29 3b 0d 09 4d 79 53 | 65 74 49 74 65 6d 54 65 |7);..MyS|etItemTe|
|000028d0| 78 74 28 64 6c 67 2c 20 | 69 64 2c 20 73 29 3b 0d |xt(dlg, |id, s);.|
|000028e0| 7d 20 2f 2f 20 4d 79 53 | 65 74 45 78 74 65 6e 64 |} // MyS|etExtend|
|000028f0| 65 64 49 74 65 6d 0d 0d | 42 6f 6f 6c 65 61 6e 20 |edItem..|Boolean |
|00002900| 4d 79 47 65 74 45 78 74 | 65 6e 64 65 64 49 74 65 |MyGetExt|endedIte|
|00002910| 6d 28 44 69 61 6c 6f 67 | 44 61 74 61 2a 20 64 6c |m(Dialog|Data* dl|
|00002920| 67 2c 20 73 68 6f 72 74 | 20 69 64 2c 20 64 6f 75 |g, short| id, dou|
|00002930| 62 6c 65 2a 20 63 6f 6e | 73 74 20 76 61 6c 29 0d |ble* con|st val).|
|00002940| 09 2f 2f 20 72 65 74 72 | 69 65 76 65 73 20 61 20 |.// retr|ieves a |
|00002950| 66 6c 6f 61 74 69 6e 67 | 20 70 6f 69 6e 74 20 6e |floating| point n|
|00002960| 75 6d 62 65 72 20 66 72 | 6f 6d 20 61 20 74 65 78 |umber fr|om a tex|
|00002970| 74 20 69 74 65 6d 0d 09 | 2f 2f 20 69 66 20 63 6f |t item..|// if co|
|00002980| 6e 76 65 72 73 69 6f 6e | 20 66 61 69 6c 73 3a 20 |nversion| fails: |
|00002990| 76 61 6c 20 69 73 20 75 | 6e 63 68 61 6e 67 65 64 |val is u|nchanged|
|000029a0| 2c 20 74 68 65 20 74 65 | 78 74 20 69 73 20 73 65 |, the te|xt is se|
|000029b0| 6c 65 63 74 65 64 2c 20 | 61 6e 64 20 66 61 6c 73 |lected, |and fals|
|000029c0| 65 20 69 73 20 72 65 74 | 75 72 6e 65 64 0d 7b 0d |e is ret|urned.{.|
|000029d0| 09 53 74 72 32 35 35 09 | 73 3b 0d 09 64 6f 75 62 |.Str255.|s;..doub|
|000029e0| 6c 65 09 64 3b 0d 0d 09 | 4d 79 47 65 74 49 74 65 |le.d;...|MyGetIte|
|000029f0| 6d 54 65 78 74 28 64 6c | 67 2c 20 69 64 2c 20 73 |mText(dl|g, id, s|
|00002a00| 29 3b 0d 0d 09 69 66 20 | 28 53 74 72 32 35 35 54 |);...if |(Str255T|
|00002a10| 6f 4e 75 6d 62 65 72 28 | 73 2c 20 26 64 29 20 3e |oNumber(|s, &d) >|
|00002a20| 20 31 29 0d 09 7b 0d 09 | 09 4d 79 53 65 6c 65 63 | 1)..{..|.MySelec|
|00002a30| 74 49 74 65 6d 54 65 78 | 74 28 64 6c 67 2c 20 69 |tItemTex|t(dlg, i|
|00002a40| 64 2c 20 30 2c 20 30 78 | 37 46 46 46 29 3b 0d 09 |d, 0, 0x|7FFF);..|
|00002a50| 09 53 79 73 42 65 65 70 | 28 33 30 29 3b 0d 09 09 |.SysBeep|(30);...|
|00002a60| 72 65 74 75 72 6e 20 66 | 61 6c 73 65 3b 0d 09 7d |return f|alse;..}|
|00002a70| 0d 09 2a 76 61 6c 20 3d | 20 64 3b 0d 09 72 65 74 |..*val =| d;..ret|
|00002a80| 75 72 6e 20 74 72 75 65 | 3b 0d 7d 0d 0d 76 6f 69 |urn true|;.}..voi|
|00002a90| 64 20 4d 79 53 65 74 4c | 6f 6e 67 49 74 65 6d 28 |d MySetL|ongItem(|
|00002aa0| 44 69 61 6c 6f 67 44 61 | 74 61 2a 20 64 6c 67 2c |DialogDa|ta* dlg,|
|00002ab0| 20 73 68 6f 72 74 20 69 | 64 2c 20 6c 6f 6e 67 20 | short i|d, long |
|00002ac0| 76 61 6c 29 0d 09 2f 2f | 20 73 65 74 73 20 61 20 |val)..//| sets a |
|00002ad0| 74 65 78 74 20 69 74 65 | 6d 20 74 6f 20 61 20 6c |text ite|m to a l|
|00002ae0| 6f 6e 67 69 6e 74 20 6e | 75 6d 62 65 72 0d 7b 0d |ongint n|umber.{.|
|00002af0| 09 53 74 72 32 35 35 09 | 73 3b 0d 09 4e 75 6d 54 |.Str255.|s;..NumT|
|00002b00| 6f 53 74 72 69 6e 67 28 | 76 61 6c 2c 20 73 29 3b |oString(|val, s);|
|00002b10| 0d 09 4d 79 53 65 74 49 | 74 65 6d 54 65 78 74 28 |..MySetI|temText(|
|00002b20| 64 6c 67 2c 20 69 64 2c | 20 73 29 3b 0d 7d 20 2f |dlg, id,| s);.} /|
|00002b30| 2f 20 4d 79 53 65 74 4c | 6f 6e 67 49 74 65 6d 0d |/ MySetL|ongItem.|
|00002b40| 0d 42 6f 6f 6c 65 61 6e | 20 4d 79 47 65 74 4c 6f |.Boolean| MyGetLo|
|00002b50| 6e 67 49 74 65 6d 28 44 | 69 61 6c 6f 67 44 61 74 |ngItem(D|ialogDat|
|00002b60| 61 2a 20 64 6c 67 2c 20 | 73 68 6f 72 74 20 69 64 |a* dlg, |short id|
|00002b70| 2c 20 6c 6f 6e 67 2a 20 | 63 6f 6e 73 74 20 76 61 |, long* |const va|
|00002b80| 6c 29 0d 09 2f 2f 20 72 | 65 74 72 69 65 76 65 73 |l)..// r|etrieves|
|00002b90| 20 61 20 6c 6f 6e 67 69 | 6e 74 20 6e 75 6d 62 65 | a longi|nt numbe|
|00002ba0| 72 20 66 72 6f 6d 20 61 | 20 74 65 78 74 20 69 74 |r from a| text it|
|00002bb0| 65 6d 0d 09 2f 2f 20 69 | 66 20 63 6f 6e 76 65 72 |em..// i|f conver|
|00002bc0| 73 69 6f 6e 20 66 61 69 | 6c 73 3a 20 76 61 6c 20 |sion fai|ls: val |
|00002bd0| 69 73 20 75 6e 63 68 61 | 6e 67 65 64 2c 20 74 68 |is uncha|nged, th|
|00002be0| 65 20 74 65 78 74 20 69 | 73 20 73 65 6c 65 63 74 |e text i|s select|
|00002bf0| 65 64 2c 20 61 6e 64 20 | 66 61 6c 73 65 20 69 73 |ed, and |false is|
|00002c00| 20 72 65 74 75 72 6e 65 | 64 0d 7b 0d 09 64 6f 75 | returne|d.{..dou|
|00002c10| 62 6c 65 09 64 3b 0d 09 | 69 66 20 28 4d 79 47 65 |ble.d;..|if (MyGe|
|00002c20| 74 45 78 74 65 6e 64 65 | 64 49 74 65 6d 28 64 6c |tExtende|dItem(dl|
|00002c30| 67 2c 20 69 64 2c 20 26 | 64 29 20 3d 3d 20 66 61 |g, id, &|d) == fa|
|00002c40| 6c 73 65 29 20 72 65 74 | 75 72 6e 20 66 61 6c 73 |lse) ret|urn fals|
|00002c50| 65 3b 0d 09 69 66 20 28 | 64 3c 20 28 64 6f 75 62 |e;..if (|d< (doub|
|00002c60| 6c 65 29 28 2d 30 78 37 | 46 46 46 46 46 46 46 29 |le)(-0x7|FFFFFFF)|
|00002c70| 20 7c 7c 20 64 20 3e 20 | 28 64 6f 75 62 6c 65 29 | || d > |(double)|
|00002c80| 30 78 37 46 46 46 46 46 | 46 46 29 0d 09 7b 09 4d |0x7FFFFF|FF)..{.M|
|00002c90| 79 53 65 6c 65 63 74 49 | 74 65 6d 54 65 78 74 28 |ySelectI|temText(|
|00002ca0| 64 6c 67 2c 20 69 64 2c | 20 30 2c 20 30 78 37 46 |dlg, id,| 0, 0x7F|
|00002cb0| 46 46 29 3b 0d 09 09 53 | 79 73 42 65 65 70 28 33 |FF);...S|ysBeep(3|
|00002cc0| 30 29 3b 0d 09 09 72 65 | 74 75 72 6e 20 66 61 6c |0);...re|turn fal|
|00002cd0| 73 65 3b 0d 09 7d 0d 09 | 2a 76 61 6c 20 3d 20 52 |se;..}..|*val = R|
|00002ce0| 6f 75 6e 64 44 6f 75 62 | 6c 65 28 64 29 3b 0d 09 |oundDoub|le(d);..|
|00002cf0| 72 65 74 75 72 6e 20 74 | 72 75 65 3b 0d 7d 0d 0d |return t|rue;.}..|
|00002d00| 76 6f 69 64 20 4d 79 53 | 65 74 54 69 6d 65 72 28 |void MyS|etTimer(|
|00002d10| 44 69 61 6c 6f 67 44 61 | 74 61 2a 20 64 6c 67 2c |DialogDa|ta* dlg,|
|00002d20| 20 6c 6f 6e 67 20 74 69 | 63 6b 73 29 0d 7b 0d 09 | long ti|cks).{..|
|00002d30| 64 6c 67 2d 3e 74 69 6d | 65 72 20 3d 20 74 69 63 |dlg->tim|er = tic|
|00002d40| 6b 73 3b 0d 7d 0d 0d 76 | 6f 69 64 20 4d 79 53 65 |ks;.}..v|oid MySe|
|00002d50| 74 46 72 61 6d 65 28 44 | 69 61 6c 6f 67 44 61 74 |tFrame(D|ialogDat|
|00002d60| 61 2a 20 64 6c 67 2c 20 | 52 65 63 74 2a 20 63 6f |a* dlg, |Rect* co|
|00002d70| 6e 73 74 20 72 2c 20 73 | 68 6f 72 74 20 69 6e 64 |nst r, s|hort ind|
|00002d80| 65 78 29 0d 09 2f 2f 20 | 53 65 74 73 20 61 20 66 |ex)..// |Sets a f|
|00002d90| 72 61 6d 65 20 74 68 61 | 74 20 6d 75 73 74 20 62 |rame tha|t must b|
|00002da0| 65 20 64 72 61 77 6e 20 | 77 68 65 6e 65 76 65 72 |e drawn |whenever|
|00002db0| 20 74 68 65 20 64 69 61 | 6c 6f 67 20 62 6f 78 20 | the dia|log box |
|00002dc0| 69 73 20 75 70 64 61 74 | 65 64 0d 09 2f 2f 20 53 |is updat|ed..// S|
|00002dd0| 65 74 20 72 20 74 6f 20 | 6e 69 6c 20 69 66 20 79 |et r to |nil if y|
|00002de0| 6f 75 20 77 61 6e 74 20 | 74 6f 20 63 6c 65 61 72 |ou want |to clear|
|00002df0| 20 61 20 66 72 61 6d 65 | 0d 09 2f 2f 20 54 68 65 | a frame|..// The|
|00002e00| 72 65 20 61 72 65 20 75 | 70 20 74 6f 20 34 20 66 |re are u|p to 4 f|
|00002e10| 72 61 6d 65 73 2e 20 45 | 61 63 68 20 69 73 20 69 |rames. E|ach is i|
|00002e20| 64 65 6e 74 69 66 69 65 | 64 20 62 79 20 69 74 73 |dentifie|d by its|
|00002e30| 20 69 6e 64 65 78 20 28 | 30 2e 2e 33 29 0d 7b 0d | index (|0..3).{.|
|00002e40| 09 69 66 20 28 72 3d 3d | 6e 69 6c 29 20 53 65 74 |.if (r==|nil) Set|
|00002e50| 52 65 63 74 28 26 64 6c | 67 2d 3e 66 72 61 6d 65 |Rect(&dl|g->frame|
|00002e60| 73 5b 69 6e 64 65 78 5d | 2c 30 2c 30 2c 30 2c 30 |s[index]|,0,0,0,0|
|00002e70| 29 3b 0d 09 65 6c 73 65 | 20 64 6c 67 2d 3e 66 72 |);..else| dlg->fr|
|00002e80| 61 6d 65 73 5b 69 6e 64 | 65 78 5d 20 3d 20 2a 72 |ames[ind|ex] = *r|
|00002e90| 3b 0d 7d 0d 0d 76 6f 69 | 64 20 46 6c 61 73 68 43 |;.}..voi|d FlashC|
|00002ea0| 6f 6e 74 72 6f 6c 28 43 | 6f 6e 74 72 6f 6c 48 61 |ontrol(C|ontrolHa|
|00002eb0| 6e 64 6c 65 20 63 6f 6e | 74 72 6f 6c 29 0d 09 2f |ndle con|trol)../|
|00002ec0| 2f 20 68 69 6c 69 74 65 | 73 20 74 68 65 20 63 6f |/ hilite|s the co|
|00002ed0| 6e 74 72 6f 6c 20 66 6f | 72 20 61 20 6d 6f 6d 65 |ntrol fo|r a mome|
|00002ee0| 6e 74 0d 7b 0d 09 6c 6f | 6e 67 09 65 6e 64 54 69 |nt.{..lo|ng.endTi|
|00002ef0| 6d 65 3b 0d 0d 09 48 69 | 6c 69 74 65 43 6f 6e 74 |me;...Hi|liteCont|
|00002f00| 72 6f 6c 28 63 6f 6e 74 | 72 6f 6c 2c 20 31 29 3b |rol(cont|rol, 1);|
|00002f10| 0d 09 44 65 6c 61 79 28 | 38 2c 20 26 65 6e 64 54 |..Delay(|8, &endT|
|00002f20| 69 6d 65 29 3b 0d 09 48 | 69 6c 69 74 65 43 6f 6e |ime);..H|iliteCon|
|00002f30| 74 72 6f 6c 28 63 6f 6e | 74 72 6f 6c 2c 20 30 29 |trol(con|trol, 0)|
|00002f40| 3b 0d 7d 0d 0d 73 74 61 | 74 69 63 20 76 6f 69 64 |;.}..sta|tic void|
|00002f50| 20 46 6c 61 73 68 42 75 | 74 74 6f 6e 20 28 44 69 | FlashBu|tton (Di|
|00002f60| 61 6c 6f 67 44 61 74 61 | 2a 20 64 6c 67 2c 20 73 |alogData|* dlg, s|
|00002f70| 68 6f 72 74 20 69 74 65 | 6d 29 09 09 2f 2f 20 6d |hort ite|m)..// m|
|00002f80| 61 6b 65 20 74 68 65 20 | 62 75 74 74 6f 6e 20 77 |ake the |button w|
|00002f90| 69 74 68 20 69 74 65 6d | 20 6e 72 2e 20 69 74 4e |ith item| nr. itN|
|00002fa0| 72 20 66 6c 61 73 68 0d | 7b 09 73 68 6f 72 74 09 |r flash.|{.short.|
|00002fb0| 6b 69 6e 64 3b 0d 09 52 | 65 63 74 09 75 73 65 6c |kind;..R|ect.usel|
|00002fc0| 65 73 73 42 6f 78 3b 0d | 09 48 61 6e 64 6c 65 09 |essBox;.|.Handle.|
|00002fd0| 69 74 65 6d 48 3b 0d 0d | 09 47 65 74 44 49 74 65 |itemH;..|.GetDIte|
|00002fe0| 6d 28 64 6c 67 2d 3e 64 | 69 61 6c 6f 67 2c 20 69 |m(dlg->d|ialog, i|
|00002ff0| 74 65 6d 2c 20 26 6b 69 | 6e 64 2c 20 26 69 74 65 |tem, &ki|nd, &ite|
|00003000| 6d 48 2c 20 26 75 73 65 | 6c 65 73 73 42 6f 78 29 |mH, &use|lessBox)|
|00003010| 3b 09 09 2f 2f 20 67 65 | 74 20 63 6f 6e 74 72 6f |;..// ge|t contro|
|00003020| 6c 20 68 61 6e 64 6c 65 | 0d 09 69 66 20 28 6b 69 |l handle|..if (ki|
|00003030| 6e 64 20 3d 3d 20 63 74 | 72 6c 49 74 65 6d 20 7c |nd == ct|rlItem ||
|00003040| 7c 20 6b 69 6e 64 20 3d | 3d 20 73 74 61 74 54 65 || kind =|= statTe|
|00003050| 78 74 20 2d 20 31 29 09 | 09 09 09 2f 2f 20 69 66 |xt - 1).|...// if|
|00003060| 20 69 74 20 69 73 20 72 | 65 61 6c 6c 79 20 61 20 | it is r|eally a |
|00003070| 63 6f 6e 74 72 6f 6c 0d | 09 09 46 6c 61 73 68 43 |control.|..FlashC|
|00003080| 6f 6e 74 72 6f 6c 28 28 | 43 6f 6e 74 72 6f 6c 48 |ontrol((|ControlH|
|00003090| 61 6e 64 6c 65 29 28 69 | 74 65 6d 48 29 29 3b 0d |andle)(i|temH));.|
|000030a0| 7d 0d 0d 0d 23 70 72 61 | 67 6d 61 20 6d 61 72 6b |}...#pra|gma mark|
|000030b0| 20 2d 0d 0d 0d 76 6f 69 | 64 20 41 64 64 49 74 65 | -...voi|d AddIte|
|000030c0| 6d 54 6f 4d 65 6e 75 28 | 4d 65 6e 75 48 61 6e 64 |mToMenu(|MenuHand|
|000030d0| 6c 65 20 6d 65 6e 75 2c | 20 53 74 72 32 35 35 20 |le menu,| Str255 |
|000030e0| 6e 61 6d 65 29 0d 09 2f | 2f 20 61 64 64 73 20 61 |name)../|/ adds a|
|000030f0| 6e 20 69 74 65 6d 20 77 | 69 74 68 20 74 68 65 20 |n item w|ith the |
|00003100| 67 69 76 65 6e 20 6e 61 | 6d 65 20 74 6f 20 74 68 |given na|me to th|
|00003110| 65 20 67 69 76 65 6e 20 | 6d 65 6e 75 0d 09 2f 2f |e given |menu..//|
|00003120| 20 6d 61 6b 65 73 20 73 | 75 72 65 20 74 68 61 74 | makes s|ure that|
|00003130| 20 74 68 65 20 6e 61 6d | 65 20 63 6f 6e 74 61 69 | the nam|e contai|
|00003140| 6e 73 20 6e 6f 20 69 6c | 6c 65 67 61 6c 20 63 68 |ns no il|legal ch|
|00003150| 61 72 61 63 74 65 72 73 | 20 74 68 61 74 20 77 6f |aracters| that wo|
|00003160| 75 6c 64 20 6d 65 73 73 | 20 75 70 20 74 68 65 20 |uld mess| up the |
|00003170| 6d 65 6e 75 0d 7b 0d 09 | 69 66 20 28 4c 65 6e 67 |menu.{..|if (Leng|
|00003180| 74 68 28 6e 61 6d 65 29 | 3e 30 20 26 26 20 6e 61 |th(name)|>0 && na|
|00003190| 6d 65 5b 31 5d 3d 3d 27 | 2d 27 29 20 6e 61 6d 65 |me[1]=='|-') name|
|000031a0| 5b 31 5d 20 3d 20 32 30 | 38 3b 09 2f 2f 20 72 65 |[1] = 20|8;.// re|
|000031b0| 70 6c 61 63 65 20 27 2d | 27 20 62 79 20 6f 70 74 |place '-|' by opt|
|000031c0| 69 6f 6e 2d 64 61 73 68 | 20 62 65 63 61 75 73 65 |ion-dash| because|
|000031d0| 20 27 2d 27 20 6d 61 6b | 65 73 20 73 65 70 61 72 | '-' mak|es separ|
|000031e0| 61 74 69 6f 6e 0d 09 41 | 70 70 65 6e 64 4d 65 6e |ation..A|ppendMen|
|000031f0| 75 28 6d 65 6e 75 2c 20 | 22 5c 70 20 22 29 3b 09 |u(menu, |"\p ");.|
|00003200| 09 09 09 09 09 09 2f 2f | 20 64 6f 6e 27 74 20 75 |......//| don't u|
|00003210| 73 65 20 41 70 70 65 6e | 64 4d 65 6e 75 20 66 6f |se Appen|dMenu fo|
|00003220| 72 20 61 64 64 69 6e 67 | 20 74 68 65 20 6e 61 6d |r adding| the nam|
|00003230| 65 20 62 65 63 61 75 73 | 65 20 69 74 20 72 65 63 |e becaus|e it rec|
|00003240| 6f 67 6e 69 7a 65 73 20 | 61 20 6c 6f 74 20 6f 66 |ognizes |a lot of|
|00003250| 20 6d 65 74 61 20 63 68 | 61 72 73 0d 09 53 65 74 | meta ch|ars..Set|
|00003260| 4d 65 6e 75 49 74 65 6d | 54 65 78 74 28 6d 65 6e |MenuItem|Text(men|
|00003270| 75 2c 20 43 6f 75 6e 74 | 4d 49 74 65 6d 73 28 6d |u, Count|MItems(m|
|00003280| 65 6e 75 29 2c 20 6e 61 | 6d 65 29 3b 0d 7d 0d 0d |enu), na|me);.}..|
|00003290| 0d 76 6f 69 64 20 4d 61 | 6b 65 57 69 6e 64 6f 77 |.void Ma|keWindow|
|000032a0| 50 6f 70 75 70 28 44 69 | 61 6c 6f 67 44 61 74 61 |Popup(Di|alogData|
|000032b0| 2a 20 64 6c 67 2c 20 73 | 68 6f 72 74 20 69 74 65 |* dlg, s|hort ite|
|000032c0| 6d 2c 20 6c 6f 6e 67 20 | 77 69 6e 64 6f 77 54 79 |m, long |windowTy|
|000032d0| 70 65 29 0d 09 2f 2f 20 | 61 64 64 73 20 61 20 6c |pe)..// |adds a l|
|000032e0| 69 73 74 20 6f 66 20 77 | 69 6e 64 6f 77 73 20 74 |ist of w|indows t|
|000032f0| 6f 20 74 68 65 20 67 69 | 76 65 6e 20 70 6f 70 75 |o the gi|ven popu|
|00003300| 70 20 69 74 65 6d 0d 09 | 2f 2f 20 77 69 6e 64 6f |p item..|// windo|
|00003310| 77 54 79 70 65 20 63 61 | 6e 20 62 65 20 64 72 61 |wType ca|n be dra|
|00003320| 77 69 6e 67 54 79 70 65 | 2c 20 64 61 74 61 54 79 |wingType|, dataTy|
|00003330| 70 65 20 6f 72 20 74 65 | 78 74 54 79 70 65 20 61 |pe or te|xtType a|
|00003340| 6e 64 20 64 65 66 69 6e | 65 73 0d 09 2f 2f 20 74 |nd defin|es..// t|
|00003350| 68 65 20 77 69 6e 64 6f | 77 20 74 79 70 65 20 74 |he windo|w type t|
|00003360| 68 61 74 20 73 68 6f 75 | 6c 64 20 62 65 20 61 64 |hat shou|ld be ad|
|00003370| 64 65 64 20 74 6f 20 74 | 68 65 20 6d 65 6e 75 0d |ded to t|he menu.|
|00003380| 7b 0d 09 4d 65 6e 75 48 | 61 6e 64 6c 65 09 09 6d |{..MenuH|andle..m|
|00003390| 65 6e 75 3b 0d 09 43 6f | 6e 74 72 6f 6c 48 61 6e |enu;..Co|ntrolHan|
|000033a0| 64 6c 65 09 63 6f 6e 74 | 72 6f 6c 20 3d 20 28 43 |dle.cont|rol = (C|
|000033b0| 6f 6e 74 72 6f 6c 48 61 | 6e 64 6c 65 29 4d 79 47 |ontrolHa|ndle)MyG|
|000033c0| 65 74 49 74 65 6d 48 61 | 6e 64 6c 65 28 64 6c 67 |etItemHa|ndle(dlg|
|000033d0| 2c 69 74 65 6d 29 3b 0d | 09 57 69 6e 64 6f 77 41 |,item);.|.WindowA|
|000033e0| 72 72 61 79 2a 2a 09 61 | 72 72 61 79 3b 0d 09 6c |rray**.a|rray;..l|
|000033f0| 6f 6e 67 09 09 09 63 6f | 75 6e 74 3b 0d 09 6c 6f |ong...co|unt;..lo|
|00003400| 6e 67 09 09 09 77 69 6e | 64 6f 77 52 65 66 3b 0d |ng...win|dowRef;.|
|00003410| 0d 09 69 66 20 28 63 6f | 6e 74 72 6f 6c 3d 3d 6e |..if (co|ntrol==n|
|00003420| 69 6c 29 20 72 65 74 75 | 72 6e 3b 09 09 09 09 09 |il) retu|rn;.....|
|00003430| 09 09 09 09 09 2f 2f 20 | 73 68 6f 75 6c 64 20 6e |.....// |should n|
|00003440| 65 76 65 72 20 68 61 70 | 70 65 6e 0d 09 6d 65 6e |ever hap|pen..men|
|00003450| 75 20 3d 20 28 2a 2a 28 | 50 6f 70 75 70 50 72 69 |u = (**(|PopupPri|
|00003460| 76 61 74 65 44 61 74 61 | 2a 2a 29 28 2a 2a 63 6f |vateData|**)(**co|
|00003470| 6e 74 72 6f 6c 29 2e 63 | 6f 6e 74 72 6c 44 61 74 |ntrol).c|ontrlDat|
|00003480| 61 29 2e 6d 48 61 6e 64 | 6c 65 3b 09 2f 2f 20 61 |a).mHand|le;.// a|
|00003490| 20 68 61 6e 64 6c 65 20 | 74 6f 20 74 68 65 20 6d | handle |to the m|
|000034a0| 65 6e 75 0d 09 69 66 20 | 28 6d 65 6e 75 3d 3d 6e |enu..if |(menu==n|
|000034b0| 69 6c 29 20 72 65 74 75 | 72 6e 3b 09 09 09 09 09 |il) retu|rn;.....|
|000034c0| 09 09 09 09 09 09 2f 2f | 20 73 68 6f 75 6c 64 20 |......//| should |
|000034d0| 6e 65 76 65 72 20 68 61 | 70 70 65 6e 0d 0d 09 61 |never ha|ppen...a|
|000034e0| 72 72 61 79 20 3d 20 28 | 57 69 6e 64 6f 77 41 72 |rray = (|WindowAr|
|000034f0| 72 61 79 2a 2a 29 4e 65 | 77 48 61 6e 64 6c 65 43 |ray**)Ne|wHandleC|
|00003500| 6c 65 61 72 28 73 69 7a | 65 6f 66 28 57 69 6e 64 |lear(siz|eof(Wind|
|00003510| 6f 77 41 72 72 61 79 29 | 29 3b 0d 09 69 66 20 28 |owArray)|);..if (|
|00003520| 61 72 72 61 79 20 3d 3d | 20 6e 69 6c 29 20 72 65 |array ==| nil) re|
|00003530| 74 75 72 6e 3b 0d 0d 09 | 64 6c 67 2d 3e 69 74 65 |turn;...|dlg->ite|
|00003540| 6d 73 5b 69 74 65 6d 5d | 2e 74 79 70 65 20 3d 20 |ms[item]|.type = |
|00003550| 77 69 6e 64 6f 77 50 6f | 70 75 70 49 74 65 6d 3b |windowPo|pupItem;|
|00003560| 0d 09 64 6c 67 2d 3e 69 | 74 65 6d 73 5b 69 74 65 |..dlg->i|tems[ite|
|00003570| 6d 5d 2e 64 61 74 61 20 | 3d 20 61 72 72 61 79 3b |m].data |= array;|
|00003580| 0d 0d 09 77 68 69 6c 65 | 28 43 6f 75 6e 74 4d 49 |...while|(CountMI|
|00003590| 74 65 6d 73 28 6d 65 6e | 75 29 29 20 44 65 6c 65 |tems(men|u)) Dele|
|000035a0| 74 65 4d 65 6e 75 49 74 | 65 6d 28 6d 65 6e 75 2c |teMenuIt|em(menu,|
|000035b0| 20 31 29 3b 09 2f 2f 20 | 64 65 6c 65 74 65 20 61 | 1);.// |delete a|
|000035c0| 6c 6c 20 70 72 65 73 65 | 6e 74 20 69 74 65 6d 73 |ll prese|nt items|
|000035d0| 20 69 6e 20 74 68 65 20 | 6d 65 6e 75 0d 0d 09 63 | in the |menu...c|
|000035e0| 6f 75 6e 74 20 3d 20 30 | 3b 0d 09 77 69 6e 64 6f |ount = 0|;..windo|
|000035f0| 77 52 65 66 20 3d 20 46 | 72 6f 6e 74 6d 6f 73 74 |wRef = F|rontmost|
|00003600| 57 69 6e 64 6f 77 28 77 | 69 6e 64 6f 77 54 79 70 |Window(w|indowTyp|
|00003610| 65 29 3b 09 09 09 09 2f | 2f 20 6e 6f 77 20 66 69 |e);..../|/ now fi|
|00003620| 6e 64 20 61 6c 6c 20 77 | 69 6e 64 6f 77 73 0d 09 |nd all w|indows..|
|00003630| 77 68 69 6c 65 20 28 77 | 69 6e 64 6f 77 52 65 66 |while (w|indowRef|
|00003640| 20 26 26 20 63 6f 75 6e | 74 20 3c 20 6d 61 78 4e | && coun|t < maxN|
|00003650| 72 49 74 65 6d 73 49 6e | 57 69 6e 64 6f 77 50 6f |rItemsIn|WindowPo|
|00003660| 70 75 70 29 0d 09 7b 09 | 69 66 20 28 47 65 74 57 |pup)..{.|if (GetW|
|00003670| 69 6e 64 6f 77 54 79 70 | 65 28 77 69 6e 64 6f 77 |indowTyp|e(window|
|00003680| 52 65 66 29 20 3d 3d 20 | 77 69 6e 64 6f 77 54 79 |Ref) == |windowTy|
|00003690| 70 65 29 0d 09 09 7b 09 | 53 74 72 32 35 35 09 73 |pe)...{.|Str255.s|
|000036a0| 3b 0d 09 09 09 28 2a 2a | 61 72 72 61 79 29 5b 63 |;....(**|array)[c|
|000036b0| 6f 75 6e 74 2b 2b 5d 20 | 3d 20 77 69 6e 64 6f 77 |ount++] |= window|
|000036c0| 52 65 66 3b 0d 09 09 09 | 47 65 74 57 69 6e 64 6f |Ref;....|GetWindo|
|000036d0| 77 54 69 74 6c 65 28 77 | 69 6e 64 6f 77 52 65 66 |wTitle(w|indowRef|
|000036e0| 2c 20 73 29 3b 0d 09 09 | 09 41 64 64 49 74 65 6d |, s);...|.AddItem|
|000036f0| 54 6f 4d 65 6e 75 28 6d | 65 6e 75 2c 20 73 29 3b |ToMenu(m|enu, s);|
|00003700| 0d 09 09 7d 0d 09 09 77 | 69 6e 64 6f 77 52 65 66 |...}...w|indowRef|
|00003710| 20 3d 20 4e 65 78 74 57 | 69 6e 64 6f 77 28 77 69 | = NextW|indow(wi|
|00003720| 6e 64 6f 77 52 65 66 29 | 3b 0d 09 7d 0d 09 53 65 |ndowRef)|;..}..Se|
|00003730| 74 43 6f 6e 74 72 6f 6c | 4d 61 78 69 6d 75 6d 28 |tControl|Maximum(|
|00003740| 63 6f 6e 74 72 6f 6c 2c | 20 63 6f 75 6e 74 29 3b |control,| count);|
|00003750| 0d 09 53 65 74 43 6f 6e | 74 72 6f 6c 56 61 6c 75 |..SetCon|trolValu|
|00003760| 65 28 63 6f 6e 74 72 6f | 6c 2c 20 31 29 3b 0d 7d |e(contro|l, 1);.}|
|00003770| 0d 0d 0d 73 74 61 74 69 | 63 20 76 6f 69 64 20 55 |...stati|c void U|
|00003780| 70 64 61 74 65 43 6f 6c | 75 6d 6e 50 6f 70 75 70 |pdateCol|umnPopup|
|00003790| 28 44 69 61 6c 6f 67 44 | 61 74 61 2a 20 64 6c 67 |(DialogD|ata* dlg|
|000037a0| 2c 20 73 68 6f 72 74 20 | 69 74 65 6d 29 0d 09 2f |, short |item)../|
|000037b0| 2f 20 75 70 64 61 74 65 | 73 20 61 20 63 6f 6c 75 |/ update|s a colu|
|000037c0| 6d 6e 20 70 6f 70 75 70 | 20 74 6f 20 74 68 65 20 |mn popup| to the |
|000037d0| 6e 61 6d 65 73 20 6f 66 | 20 69 74 73 20 77 69 6e |names of| its win|
|000037e0| 64 6f 77 0d 7b 0d 09 4d | 65 6e 75 48 61 6e 64 6c |dow.{..M|enuHandl|
|000037f0| 65 09 09 6d 65 6e 75 3b | 0d 09 43 6f 6e 74 72 6f |e..menu;|..Contro|
|00003800| 6c 48 61 6e 64 6c 65 09 | 63 6f 6e 74 72 6f 6c 20 |lHandle.|control |
|00003810| 3d 20 28 43 6f 6e 74 72 | 6f 6c 48 61 6e 64 6c 65 |= (Contr|olHandle|
|00003820| 29 4d 79 47 65 74 49 74 | 65 6d 48 61 6e 64 6c 65 |)MyGetIt|emHandle|
|00003830| 28 64 6c 67 2c 69 74 65 | 6d 29 3b 0d 09 6c 6f 6e |(dlg,ite|m);..lon|
|00003840| 67 09 09 09 77 69 6e 64 | 6f 77 52 65 66 49 44 3b |g...wind|owRefID;|
|00003850| 0d 09 73 68 6f 72 74 09 | 09 09 77 69 6e 64 6f 77 |..short.|..window|
|00003860| 50 6f 70 75 70 49 74 65 | 6d 09 3d 20 64 6c 67 2d |PopupIte|m.= dlg-|
|00003870| 3e 69 74 65 6d 73 5b 69 | 74 65 6d 5d 2e 6e 32 3b |>items[i|tem].n2;|
|00003880| 0d 09 73 68 6f 72 74 09 | 09 09 77 68 61 74 20 3d |..short.|..what =|
|00003890| 20 64 6c 67 2d 3e 69 74 | 65 6d 73 5b 69 74 65 6d | dlg->it|ems[item|
|000038a0| 5d 2e 6e 31 3b 09 09 09 | 09 09 09 2f 2f 20 30 20 |].n1;...|...// 0 |
|000038b0| 69 66 20 61 6c 6c 20 63 | 6f 6c 75 6d 6e 73 2c 20 |if all c|olumns, |
|000038c0| 31 20 69 66 20 6f 6e 6c | 79 20 64 61 74 61 20 63 |1 if onl|y data c|
|000038d0| 6f 6c 75 6d 6e 73 2c 20 | 32 20 69 66 20 6f 6e 6c |olumns, |2 if onl|
|000038e0| 79 20 74 65 78 74 20 63 | 6f 6c 75 6d 6e 73 0d 09 |y text c|olumns..|
|000038f0| 6c 6f 6e 67 09 09 09 69 | 3b 0d 09 6c 6f 6e 67 09 |long...i|;..long.|
|00003900| 09 09 6f 6c 64 43 75 72 | 72 65 6e 74 44 61 74 61 |..oldCur|rentData|
|00003910| 57 69 6e 64 6f 77 20 3d | 20 47 65 74 43 75 72 72 |Window =| GetCurr|
|00003920| 65 6e 74 57 69 6e 64 6f | 77 28 64 61 74 61 54 79 |entWindo|w(dataTy|
|00003930| 70 65 29 3b 0d 09 6c 6f | 6e 67 09 09 09 6e 72 43 |pe);..lo|ng...nrC|
|00003940| 6f 6c 73 3b 0d 09 47 72 | 61 66 50 74 72 09 09 09 |ols;..Gr|afPtr...|
|00003950| 6f 6c 64 50 6f 72 74 3b | 0d 0d 09 69 66 20 28 63 |oldPort;|...if (c|
|00003960| 6f 6e 74 72 6f 6c 3d 3d | 6e 69 6c 29 20 72 65 74 |ontrol==|nil) ret|
|00003970| 75 72 6e 3b 09 09 09 09 | 09 09 09 09 09 09 2f 2f |urn;....|......//|
|00003980| 20 73 68 6f 75 6c 64 20 | 6e 65 76 65 72 20 68 61 | should |never ha|
|00003990| 70 70 65 6e 0d 09 6d 65 | 6e 75 20 3d 20 28 2a 2a |ppen..me|nu = (**|
|000039a0| 28 50 6f 70 75 70 50 72 | 69 76 61 74 65 44 61 74 |(PopupPr|ivateDat|
|000039b0| 61 2a 2a 29 28 2a 2a 63 | 6f 6e 74 72 6f 6c 29 2e |a**)(**c|ontrol).|
|000039c0| 63 6f 6e 74 72 6c 44 61 | 74 61 29 2e 6d 48 61 6e |contrlDa|ta).mHan|
|000039d0| 64 6c 65 3b 09 2f 2f 20 | 61 20 68 61 6e 64 6c 65 |dle;.// |a handle|
|000039e0| 20 74 6f 20 74 68 65 20 | 6d 65 6e 75 0d 09 69 66 | to the |menu..if|
|000039f0| 20 28 6d 65 6e 75 3d 3d | 6e 69 6c 29 20 72 65 74 | (menu==|nil) ret|
|00003a00| 75 72 6e 3b 09 09 09 09 | 09 09 09 09 09 09 09 2f |urn;....|......./|
|00003a10| 2f 20 73 68 6f 75 6c 64 | 20 6e 65 76 65 72 20 68 |/ should| never h|
|00003a20| 61 70 70 65 6e 0d 0d 09 | 69 66 20 28 77 69 6e 64 |appen...|if (wind|
|00003a30| 6f 77 50 6f 70 75 70 49 | 74 65 6d 20 21 3d 20 30 |owPopupI|tem != 0|
|00003a40| 29 20 47 65 74 49 74 65 | 6d 47 65 6e 65 72 61 6c |) GetIte|mGeneral|
|00003a50| 28 64 6c 67 2c 20 77 69 | 6e 64 6f 77 50 6f 70 75 |(dlg, wi|ndowPopu|
|00003a60| 70 49 74 65 6d 2c 20 26 | 77 69 6e 64 6f 77 52 65 |pItem, &|windowRe|
|00003a70| 66 49 44 29 3b 0d 09 65 | 6c 73 65 20 77 69 6e 64 |fID);..e|lse wind|
|00003a80| 6f 77 52 65 66 49 44 20 | 3d 20 46 72 6f 6e 74 6d |owRefID |= Frontm|
|00003a90| 6f 73 74 57 69 6e 64 6f | 77 28 64 61 74 61 54 79 |ostWindo|w(dataTy|
|00003aa0| 70 65 29 3b 0d 0d 09 69 | 66 20 28 64 6c 67 2d 3e |pe);...i|f (dlg->|
|00003ab0| 69 74 65 6d 73 5b 69 74 | 65 6d 5d 2e 6e 33 20 3d |items[it|em].n3 =|
|00003ac0| 3d 20 77 69 6e 64 6f 77 | 52 65 66 49 44 29 20 72 |= window|RefID) r|
|00003ad0| 65 74 75 72 6e 3b 09 09 | 09 09 09 2f 2f 20 69 66 |eturn;..|...// if|
|00003ae0| 20 74 68 65 20 77 69 6e | 64 6f 77 20 64 69 64 20 | the win|dow did |
|00003af0| 6e 6f 74 20 63 68 61 6e | 67 65 0d 09 64 6c 67 2d |not chan|ge..dlg-|
|00003b00| 3e 69 74 65 6d 73 5b 69 | 74 65 6d 5d 2e 6e 33 20 |>items[i|tem].n3 |
|00003b10| 3d 20 77 69 6e 64 6f 77 | 52 65 66 49 44 3b 0d 0d |= window|RefID;..|
|00003b20| 09 77 68 69 6c 65 28 43 | 6f 75 6e 74 4d 49 74 65 |.while(C|ountMIte|
|00003b30| 6d 73 28 6d 65 6e 75 29 | 29 20 44 65 6c 65 74 65 |ms(menu)|) Delete|
|00003b40| 4d 65 6e 75 49 74 65 6d | 28 6d 65 6e 75 2c 20 31 |MenuItem|(menu, 1|
|00003b50| 29 3b 09 09 09 09 2f 2f | 20 64 65 6c 65 74 65 20 |);....//| delete |
|00003b60| 61 6c 6c 20 70 72 65 73 | 65 6e 74 20 69 74 65 6d |all pres|ent item|
|00003b70| 73 20 69 6e 20 74 68 65 | 20 6d 65 6e 75 0d 0d 09 |s in the| menu...|
|00003b80| 69 66 20 28 77 69 6e 64 | 6f 77 52 65 66 49 44 29 |if (wind|owRefID)|
|00003b90| 0d 09 7b 09 53 65 74 43 | 75 72 72 65 6e 74 57 69 |..{.SetC|urrentWi|
|00003ba0| 6e 64 6f 77 28 77 69 6e | 64 6f 77 52 65 66 49 44 |ndow(win|dowRefID|
|00003bb0| 29 3b 0d 09 09 6e 72 43 | 6f 6c 73 20 3d 20 4e 72 |);...nrC|ols = Nr|
|00003bc0| 43 6f 6c 73 28 29 3b 0d | 09 09 69 66 20 28 6e 72 |Cols();.|..if (nr|
|00003bd0| 43 6f 6c 73 20 3e 20 31 | 32 38 29 20 6e 72 43 6f |Cols > 1|28) nrCo|
|00003be0| 6c 73 20 3d 20 31 32 38 | 3b 09 09 09 09 09 09 09 |ls = 128|;.......|
|00003bf0| 09 2f 2f 20 6c 69 6d 69 | 74 20 74 68 65 20 73 69 |.// limi|t the si|
|00003c00| 7a 65 20 6f 66 20 74 68 | 65 20 70 6f 70 75 70 0d |ze of th|e popup.|
|00003c10| 09 09 66 6f 72 20 28 69 | 3d 31 3b 20 69 3c 3d 6e |..for (i|=1; i<=n|
|00003c20| 72 43 6f 6c 73 3b 20 69 | 2b 2b 29 0d 09 09 7b 0d |rCols; i|++)...{.|
|00003c30| 09 09 09 6c 6f 6e 67 09 | 63 6f 6c 54 79 70 65 20 |...long.|colType |
|00003c40| 3d 20 47 65 74 43 6f 6c | 54 79 70 65 28 69 29 3b |= GetCol|Type(i);|
|00003c50| 0d 09 0d 09 09 09 69 66 | 20 28 20 77 68 61 74 20 |......if| ( what |
|00003c60| 3d 3d 20 30 20 7c 7c 0d | 09 09 09 09 28 77 68 61 |== 0 ||.|....(wha|
|00003c70| 74 20 3d 3d 20 31 20 26 | 26 20 28 63 6f 6c 54 79 |t == 1 &|& (colTy|
|00003c80| 70 65 20 3d 3d 20 66 6c | 6f 61 74 43 6f 6c 75 6d |pe == fl|oatColum|
|00003c90| 6e 20 7c 7c 20 63 6f 6c | 54 79 70 65 20 3d 3d 20 |n || col|Type == |
|00003ca0| 64 6f 75 62 6c 65 43 6f | 6c 75 6d 6e 29 29 20 7c |doubleCo|lumn)) ||
|00003cb0| 7c 0d 09 09 09 09 28 77 | 68 61 74 20 3d 3d 20 32 ||.....(w|hat == 2|
|00003cc0| 20 26 26 20 63 6f 6c 54 | 79 70 65 20 3d 3d 20 74 | && colT|ype == t|
|00003cd0| 65 78 74 43 6f 6c 75 6d | 6e 29 29 0d 09 09 09 09 |extColum|n)).....|
|00003ce0| 09 7b 0d 09 09 09 09 09 | 09 53 74 72 32 35 35 09 |.{......|.Str255.|
|00003cf0| 73 3b 0d 09 09 09 09 09 | 09 47 65 74 43 6f 6c 4e |s;......|.GetColN|
|00003d00| 61 6d 65 28 73 2c 20 69 | 29 3b 0d 09 09 09 09 09 |ame(s, i|);......|
|00003d10| 09 41 64 64 49 74 65 6d | 54 6f 4d 65 6e 75 28 6d |.AddItem|ToMenu(m|
|00003d20| 65 6e 75 2c 20 73 29 3b | 0d 09 09 09 09 09 7d 0d |enu, s);|......}.|
|00003d30| 09 09 7d 0d 09 09 53 65 | 74 43 6f 6e 74 72 6f 6c |..}...Se|tControl|
|00003d40| 4d 61 78 69 6d 75 6d 28 | 63 6f 6e 74 72 6f 6c 2c |Maximum(|control,|
|00003d50| 20 43 6f 75 6e 74 4d 49 | 74 65 6d 73 28 6d 65 6e | CountMI|tems(men|
|00003d60| 75 29 29 3b 0d 09 09 53 | 65 74 43 75 72 72 65 6e |u));...S|etCurren|
|00003d70| 74 57 69 6e 64 6f 77 28 | 6f 6c 64 43 75 72 72 65 |tWindow(|oldCurre|
|00003d80| 6e 74 44 61 74 61 57 69 | 6e 64 6f 77 29 3b 09 09 |ntDataWi|ndow);..|
|00003d90| 09 09 09 09 09 2f 2f 20 | 72 65 73 74 6f 72 65 20 |.....// |restore |
|00003da0| 70 72 65 76 69 6f 75 73 | 20 64 61 74 61 20 77 69 |previous| data wi|
|00003db0| 6e 64 6f 77 0d 09 7d 0d | 09 47 65 74 50 6f 72 74 |ndow..}.|.GetPort|
|00003dc0| 28 26 6f 6c 64 50 6f 72 | 74 29 3b 0d 09 53 65 74 |(&oldPor|t);..Set|
|00003dd0| 50 6f 72 74 28 64 6c 67 | 2d 3e 64 69 61 6c 6f 67 |Port(dlg|->dialog|
|00003de0| 29 3b 0d 09 44 72 61 77 | 31 43 6f 6e 74 72 6f 6c |);..Draw|1Control|
|00003df0| 28 63 6f 6e 74 72 6f 6c | 29 3b 0d 09 53 65 74 50 |(control|);..SetP|
|00003e00| 6f 72 74 28 6f 6c 64 50 | 6f 72 74 29 3b 09 0d 7d |ort(oldP|ort);..}|
|00003e10| 2f 2f 55 70 64 61 74 65 | 43 6f 6c 75 6d 6e 50 6f |//Update|ColumnPo|
|00003e20| 70 75 70 0d 0d 76 6f 69 | 64 20 4d 61 6b 65 43 6f |pup..voi|d MakeCo|
|00003e30| 6c 75 6d 6e 50 6f 70 75 | 70 28 44 69 61 6c 6f 67 |lumnPopu|p(Dialog|
|00003e40| 44 61 74 61 2a 20 64 6c | 67 2c 20 73 68 6f 72 74 |Data* dl|g, short|
|00003e50| 20 69 74 65 6d 2c 20 73 | 68 6f 72 74 20 77 69 6e | item, s|hort win|
|00003e60| 64 6f 77 50 6f 70 75 70 | 2c 20 73 68 6f 72 74 20 |dowPopup|, short |
|00003e70| 77 68 61 74 29 0d 09 2f | 2f 20 61 64 64 73 20 61 |what)../|/ adds a|
|00003e80| 20 6c 69 73 74 20 6f 66 | 20 63 6f 6c 75 6d 6e 20 | list of| column |
|00003e90| 6e 61 6d 65 73 20 74 6f | 20 61 20 70 6f 70 75 70 |names to| a popup|
|00003ea0| 20 69 74 65 6d 0d 09 2f | 2f 09 77 69 6e 64 6f 77 | item../|/.window|
|00003eb0| 50 6f 70 75 70 3a 09 74 | 68 65 20 69 74 65 6d 20 |Popup:.t|he item |
|00003ec0| 69 64 20 6f 66 20 61 20 | 77 69 6e 64 6f 77 20 70 |id of a |window p|
|00003ed0| 6f 70 75 70 20 74 68 61 | 74 20 74 68 69 73 20 69 |opup tha|t this i|
|00003ee0| 74 65 6d 20 62 65 6c 6f | 6e 67 73 20 74 6f 2c 20 |tem belo|ngs to, |
|00003ef0| 30 20 69 66 20 6e 6f 6e | 65 0d 09 2f 2f 09 77 68 |0 if non|e..//.wh|
|00003f00| 61 74 3a 09 09 09 30 20 | 69 66 20 61 6c 6c 20 63 |at:...0 |if all c|
|00003f10| 6f 6c 75 6d 6e 73 2c 20 | 31 20 69 66 20 6f 6e 6c |olumns, |1 if onl|
|00003f20| 79 20 64 61 74 61 20 63 | 6f 6c 75 6d 6e 73 2c 20 |y data c|olumns, |
|00003f30| 32 20 69 66 20 6f 6e 6c | 79 20 74 65 78 74 20 63 |2 if onl|y text c|
|00003f40| 6f 6c 75 6d 6e 73 0d 7b | 0d 09 64 6c 67 2d 3e 69 |olumns.{|..dlg->i|
|00003f50| 74 65 6d 73 5b 69 74 65 | 6d 5d 2e 74 79 70 65 20 |tems[ite|m].type |
|00003f60| 3d 20 63 6f 6c 75 6d 6e | 50 6f 70 75 70 49 74 65 |= column|PopupIte|
|00003f70| 6d 3b 0d 09 64 6c 67 2d | 3e 69 74 65 6d 73 5b 69 |m;..dlg-|>items[i|
|00003f80| 74 65 6d 5d 2e 6e 31 20 | 3d 20 77 68 61 74 3b 0d |tem].n1 |= what;.|
|00003f90| 09 64 6c 67 2d 3e 69 74 | 65 6d 73 5b 69 74 65 6d |.dlg->it|ems[item|
|00003fa0| 5d 2e 6e 32 20 3d 20 77 | 69 6e 64 6f 77 50 6f 70 |].n2 = w|indowPop|
|00003fb0| 75 70 3b 0d 09 55 70 64 | 61 74 65 43 6f 6c 75 6d |up;..Upd|ateColum|
|00003fc0| 6e 50 6f 70 75 70 28 64 | 6c 67 2c 20 69 74 65 6d |nPopup(d|lg, item|
|00003fd0| 29 3b 0d 09 4d 79 53 65 | 74 49 74 65 6d 56 61 6c |);..MySe|tItemVal|
|00003fe0| 75 65 28 64 6c 67 2c 20 | 69 74 65 6d 2c 20 31 29 |ue(dlg, |item, 1)|
|00003ff0| 3b 0d 0d 7d 0d 0d 73 74 | 61 74 69 63 20 76 6f 69 |;..}..st|atic voi|
|00004000| 64 20 55 70 64 61 74 65 | 43 6f 6c 75 6d 6e 50 6f |d Update|ColumnPo|
|00004010| 70 75 70 49 74 65 6d 73 | 28 44 69 61 6c 6f 67 44 |pupItems|(DialogD|
|00004020| 61 74 61 2a 20 64 6c 67 | 2c 20 73 68 6f 72 74 20 |ata* dlg|, short |
|00004030| 69 74 65 6d 29 0d 09 2f | 2f 20 63 61 6c 6c 20 74 |item)../|/ call t|
|00004040| 68 69 73 20 72 6f 75 74 | 69 6e 65 20 69 66 20 74 |his rout|ine if t|
|00004050| 68 65 20 76 61 6c 75 65 | 20 6f 66 20 61 20 77 69 |he value| of a wi|
|00004060| 6e 64 6f 77 20 70 6f 70 | 75 70 20 69 74 65 6d 20 |ndow pop|up item |
|00004070| 68 61 73 20 63 68 61 6e | 67 65 64 0d 09 2f 2f 20 |has chan|ged..// |
|00004080| 69 74 20 67 6f 65 73 20 | 74 68 72 6f 75 67 68 20 |it goes |through |
|00004090| 61 6c 6c 20 63 6f 6c 75 | 6d 6e 20 70 6f 70 75 70 |all colu|mn popup|
|000040a0| 73 2c 20 6d 61 6b 69 6e | 67 20 73 75 72 65 20 74 |s, makin|g sure t|
|000040b0| 68 61 74 20 74 68 65 79 | 20 73 68 6f 77 20 74 68 |hat they| show th|
|000040c0| 65 20 70 72 6f 70 65 72 | 20 63 6f 6c 75 6d 73 0d |e proper| colums.|
|000040d0| 0d 7b 09 73 68 6f 72 74 | 09 69 3b 0d 09 66 6f 72 |.{.short|.i;..for|
|000040e0| 28 69 3d 30 3b 20 69 3c | 6d 61 78 4e 72 49 74 65 |(i=0; i<|maxNrIte|
|000040f0| 6d 73 3b 20 69 2b 2b 29 | 09 09 09 09 09 09 09 09 |ms; i++)|........|
|00004100| 2f 2f 20 74 65 73 74 20 | 69 66 20 74 68 65 72 65 |// test |if there|
|00004110| 20 69 73 20 61 20 63 6f | 6c 75 6d 6e 20 70 6f 70 | is a co|lumn pop|
|00004120| 75 70 20 74 68 61 74 20 | 62 65 6c 6f 6e 67 73 20 |up that |belongs |
|00004130| 74 6f 20 69 74 0d 09 09 | 69 66 20 28 64 6c 67 2d |to it...|if (dlg-|
|00004140| 3e 69 74 65 6d 73 5b 69 | 5d 2e 74 79 70 65 20 3d |>items[i|].type =|
|00004150| 3d 20 63 6f 6c 75 6d 6e | 50 6f 70 75 70 49 74 65 |= column|PopupIte|
|00004160| 6d 29 0d 09 09 09 69 66 | 20 28 64 6c 67 2d 3e 69 |m)....if| (dlg->i|
|00004170| 74 65 6d 73 5b 69 5d 2e | 6e 32 20 3d 3d 20 69 74 |tems[i].|n2 == it|
|00004180| 65 6d 29 0d 09 09 09 09 | 55 70 64 61 74 65 43 6f |em).....|UpdateCo|
|00004190| 6c 75 6d 6e 50 6f 70 75 | 70 28 64 6c 67 2c 20 69 |lumnPopu|p(dlg, i|
|000041a0| 29 3b 0d 7d 0d 0d 0d 23 | 70 72 61 67 6d 61 20 6d |);.}...#|pragma m|
|000041b0| 61 72 6b 20 2d 0d 0d 76 | 6f 69 64 20 53 65 74 49 |ark -..v|oid SetI|
|000041c0| 74 65 6d 47 65 6e 65 72 | 61 6c 28 44 69 61 6c 6f |temGener|al(Dialo|
|000041d0| 67 44 61 74 61 2a 20 64 | 6c 67 2c 20 73 68 6f 72 |gData* d|lg, shor|
|000041e0| 74 20 69 74 65 6d 2c 20 | 76 6f 69 64 2a 20 64 61 |t item, |void* da|
|000041f0| 74 61 29 0d 09 2f 2f 20 | 67 65 6e 65 72 69 63 20 |ta)..// |generic |
|00004200| 72 6f 75 74 69 6e 65 20 | 66 6f 72 20 73 65 74 74 |routine |for sett|
|00004210| 69 6e 67 20 69 74 65 6d | 73 2e 20 50 72 65 73 65 |ing item|s. Prese|
|00004220| 6e 74 6c 79 20 75 6e 75 | 73 65 64 0d 7b 0d 09 49 |ntly unu|sed.{..I|
|00004230| 74 65 6d 54 79 70 65 09 | 74 79 70 65 20 3d 20 64 |temType.|type = d|
|00004240| 6c 67 2d 3e 69 74 65 6d | 73 5b 69 74 65 6d 5d 2e |lg->item|s[item].|
|00004250| 74 79 70 65 3b 0d 0d 09 | 69 66 20 28 74 79 70 65 |type;...|if (type|
|00004260| 20 3d 3d 20 77 69 6e 64 | 6f 77 50 6f 70 75 70 49 | == wind|owPopupI|
|00004270| 74 65 6d 29 0d 09 7b 09 | 57 69 6e 64 6f 77 41 72 |tem)..{.|WindowAr|
|00004280| 72 61 79 2a 2a 09 61 72 | 72 61 79 20 3d 20 28 57 |ray**.ar|ray = (W|
|00004290| 69 6e 64 6f 77 41 72 72 | 61 79 2a 2a 29 64 6c 67 |indowArr|ay**)dlg|
|000042a0| 2d 3e 69 74 65 6d 73 5b | 69 74 65 6d 5d 2e 64 61 |->items[|item].da|
|000042b0| 74 61 3b 0d 09 09 69 6e | 74 09 09 09 09 69 3b 0d |ta;...in|t....i;.|
|000042c0| 09 09 6c 6f 6e 67 09 09 | 09 6e 65 77 44 61 74 61 |..long..|.newData|
|000042d0| 20 3d 20 2a 28 6c 6f 6e | 67 2a 29 64 61 74 61 3b | = *(lon|g*)data;|
|000042e0| 0d 0d 09 09 66 6f 72 20 | 28 69 3d 30 3b 20 69 3c |....for |(i=0; i<|
|000042f0| 6d 61 78 4e 72 49 74 65 | 6d 73 49 6e 57 69 6e 64 |maxNrIte|msInWind|
|00004300| 6f 77 50 6f 70 75 70 3b | 20 69 2b 2b 29 09 09 2f |owPopup;| i++)../|
|00004310| 2f 20 66 69 6e 64 20 77 | 69 6e 64 6f 77 20 72 65 |/ find w|indow re|
|00004320| 66 20 69 64 20 69 6e 20 | 6c 69 73 74 0d 09 09 09 |f id in |list....|
|00004330| 69 66 20 28 28 2a 2a 61 | 72 72 61 79 29 5b 69 5d |if ((**a|rray)[i]|
|00004340| 20 3d 3d 20 6e 65 77 44 | 61 74 61 29 0d 09 09 09 | == newD|ata)....|
|00004350| 7b 09 4d 79 53 65 74 49 | 74 65 6d 56 61 6c 75 65 |{.MySetI|temValue|
|00004360| 28 64 6c 67 2c 20 69 74 | 65 6d 2c 20 69 2b 31 29 |(dlg, it|em, i+1)|
|00004370| 3b 0d 09 09 09 09 55 70 | 64 61 74 65 43 6f 6c 75 |;.....Up|dateColu|
|00004380| 6d 6e 50 6f 70 75 70 49 | 74 65 6d 73 28 64 6c 67 |mnPopupI|tems(dlg|
|00004390| 2c 20 69 74 65 6d 29 3b | 09 09 2f 2f 20 73 65 61 |, item);|..// sea|
|000043a0| 72 63 68 20 66 6f 72 20 | 64 65 70 65 6e 64 65 6e |rch for |dependen|
|000043b0| 74 20 63 6f 6c 75 6d 6e | 20 70 6f 70 75 70 20 69 |t column| popup i|
|000043c0| 74 65 6d 73 0d 09 09 09 | 09 62 72 65 61 6b 3b 0d |tems....|.break;.|
|000043d0| 09 09 09 7d 0d 09 7d 0d | 7d 0d 0d 76 6f 69 64 20 |...}..}.|}..void |
|000043e0| 47 65 74 49 74 65 6d 47 | 65 6e 65 72 61 6c 28 44 |GetItemG|eneral(D|
|000043f0| 69 61 6c 6f 67 44 61 74 | 61 2a 20 64 6c 67 2c 20 |ialogDat|a* dlg, |
|00004400| 73 68 6f 72 74 20 69 74 | 65 6d 2c 20 76 6f 69 64 |short it|em, void|
|00004410| 2a 20 64 61 74 61 29 0d | 09 2f 2f 20 67 65 6e 65 |* data).|.// gene|
|00004420| 72 69 63 20 72 6f 75 74 | 69 6e 65 20 67 65 74 74 |ric rout|ine gett|
|00004430| 69 6e 67 20 74 68 65 20 | 73 65 74 74 69 6e 67 20 |ing the |setting |
|00004440| 6f 66 20 69 74 65 6d 73 | 2e 20 50 72 65 73 65 6e |of items|. Presen|
|00004450| 74 6c 79 20 72 65 63 6f | 67 6e 69 7a 65 64 20 62 |tly reco|gnized b|
|00004460| 79 0d 09 2f 2f 09 77 69 | 6e 64 6f 77 20 70 6f 70 |y..//.wi|ndow pop|
|00004470| 75 70 20 69 74 65 6d 73 | 3a 09 64 61 74 61 20 6d |up items|:.data m|
|00004480| 75 73 74 20 62 65 20 61 | 20 70 6f 69 6e 74 65 72 |ust be a| pointer|
|00004490| 20 74 6f 20 61 20 6c 6f | 6e 67 20 76 61 6c 75 65 | to a lo|ng value|
|000044a0| 2c 20 77 68 65 72 65 20 | 74 68 65 20 77 69 6e 64 |, where |the wind|
|000044b0| 6f 77 20 72 65 66 20 49 | 44 20 69 73 20 72 65 74 |ow ref I|D is ret|
|000044c0| 75 72 6e 65 64 0d 7b 0d | 09 49 74 65 6d 54 79 70 |urned.{.|.ItemTyp|
|000044d0| 65 09 74 79 70 65 20 3d | 20 64 6c 67 2d 3e 69 74 |e.type =| dlg->it|
|000044e0| 65 6d 73 5b 69 74 65 6d | 5d 2e 74 79 70 65 3b 0d |ems[item|].type;.|
|000044f0| 0d 09 69 66 20 28 74 79 | 70 65 20 3d 3d 20 77 69 |..if (ty|pe == wi|
|00004500| 6e 64 6f 77 50 6f 70 75 | 70 49 74 65 6d 29 0d 09 |ndowPopu|pItem)..|
|00004510| 7b 09 57 69 6e 64 6f 77 | 41 72 72 61 79 2a 2a 09 |{.Window|Array**.|
|00004520| 61 72 72 61 79 20 3d 20 | 28 57 69 6e 64 6f 77 41 |array = |(WindowA|
|00004530| 72 72 61 79 2a 2a 29 64 | 6c 67 2d 3e 69 74 65 6d |rray**)d|lg->item|
|00004540| 73 5b 69 74 65 6d 5d 2e | 64 61 74 61 3b 0d 09 09 |s[item].|data;...|
|00004550| 69 66 20 28 47 65 74 43 | 6f 6e 74 72 6f 6c 4d 61 |if (GetC|ontrolMa|
|00004560| 78 69 6d 75 6d 28 4d 79 | 47 65 74 49 74 65 6d 48 |ximum(My|GetItemH|
|00004570| 61 6e 64 6c 65 28 64 6c | 67 2c 20 69 74 65 6d 29 |andle(dl|g, item)|
|00004580| 29 3d 3d 30 29 09 09 09 | 2f 2f 20 69 66 20 6d 65 |)==0)...|// if me|
|00004590| 6e 75 20 69 73 20 65 6d | 70 74 79 0d 09 09 09 2a |nu is em|pty....*|
|000045a0| 28 6c 6f 6e 67 2a 29 64 | 61 74 61 20 3d 20 30 3b |(long*)d|ata = 0;|
|000045b0| 0d 09 09 65 6c 73 65 0d | 09 09 09 2a 28 6c 6f 6e |...else.|...*(lon|
|000045c0| 67 2a 29 64 61 74 61 20 | 3d 20 28 2a 2a 61 72 72 |g*)data |= (**arr|
|000045d0| 61 79 29 5b 4d 79 47 65 | 74 49 74 65 6d 56 61 6c |ay)[MyGe|tItemVal|
|000045e0| 75 65 28 64 6c 67 2c 20 | 69 74 65 6d 29 2d 31 5d |ue(dlg, |item)-1]|
|000045f0| 3b 0d 09 7d 0d 7d 0d 0d | 23 70 72 61 67 6d 61 20 |;..}.}..|#pragma |
|00004600| 6d 61 72 6b 20 2d 0d 0d | 73 74 61 74 69 63 20 76 |mark -..|static v|
|00004610| 6f 69 64 20 44 69 73 70 | 6f 73 65 4f 6e 65 49 74 |oid Disp|oseOneIt|
|00004620| 65 6d 28 44 69 61 6c 6f | 67 44 61 74 61 2a 20 64 |em(Dialo|gData* d|
|00004630| 6c 67 2c 20 73 68 6f 72 | 74 20 69 29 0d 09 2f 2f |lg, shor|t i)..//|
|00004640| 20 64 69 73 70 6f 73 65 | 73 20 61 6e 79 20 6d 65 | dispose|s any me|
|00004650| 6d 6f 72 79 20 61 6c 6c | 6f 63 61 74 65 64 20 66 |mory all|ocated f|
|00004660| 6f 72 20 61 20 67 69 76 | 65 6e 20 69 74 65 6d 0d |or a giv|en item.|
|00004670| 7b 0d 09 73 74 61 74 69 | 63 20 63 6f 6e 73 74 20 |{..stati|c const |
|00004680| 49 74 65 6d 52 65 63 6f | 72 64 20 64 65 66 61 75 |ItemReco|rd defau|
|00004690| 6c 74 52 65 63 6f 72 64 | 20 3d 20 7b 20 75 6e 6b |ltRecord| = { unk|
|000046a0| 6e 6f 77 6e 49 74 65 6d | 2c 30 2c 30 2c 30 2c 6e |nownItem|,0,0,0,n|
|000046b0| 69 6c 20 7d 3b 0d 0d 09 | 69 66 20 28 64 6c 67 2d |il };...|if (dlg-|
|000046c0| 3e 69 74 65 6d 73 5b 69 | 5d 2e 74 79 70 65 20 3d |>items[i|].type =|
|000046d0| 3d 20 77 69 6e 64 6f 77 | 50 6f 70 75 70 49 74 65 |= window|PopupIte|
|000046e0| 6d 29 0d 09 7b 09 69 66 | 20 28 64 6c 67 2d 3e 69 |m)..{.if| (dlg->i|
|000046f0| 74 65 6d 73 5b 69 5d 2e | 64 61 74 61 20 21 3d 20 |tems[i].|data != |
|00004700| 6e 69 6c 29 0d 09 09 09 | 44 69 73 70 6f 73 65 48 |nil)....|DisposeH|
|00004710| 61 6e 64 6c 65 28 28 48 | 61 6e 64 6c 65 29 64 6c |andle((H|andle)dl|
|00004720| 67 2d 3e 69 74 65 6d 73 | 5b 69 5d 2e 64 61 74 61 |g->items|[i].data|
|00004730| 29 3b 0d 09 7d 0d 09 64 | 6c 67 2d 3e 69 74 65 6d |);..}..d|lg->item|
|00004740| 73 5b 69 5d 20 3d 20 64 | 65 66 61 75 6c 74 52 65 |s[i] = d|efaultRe|
|00004750| 63 6f 72 64 3b 0d 7d 0d | 0d 76 6f 69 64 20 4d 79 |cord;.}.|.void My|
|00004760| 41 70 70 65 6e 64 44 49 | 54 4c 28 44 69 61 6c 6f |AppendDI|TL(Dialo|
|00004770| 67 44 61 74 61 2a 20 64 | 6c 67 2c 20 73 68 6f 72 |gData* d|lg, shor|
|00004780| 74 20 72 65 73 49 44 29 | 0d 09 2f 2f 20 61 70 70 |t resID)|..// app|
|00004790| 65 6e 73 20 44 49 54 4c | 20 6f 66 20 67 69 76 65 |ens DITL| of give|
|000047a0| 6e 20 72 65 73 2d 69 64 | 20 74 6f 20 64 69 61 6c |n res-id| to dial|
|000047b0| 6f 67 0d 7b 0d 09 48 61 | 6e 64 6c 65 20 68 20 3d |og.{..Ha|ndle h =|
|000047c0| 20 47 65 74 31 52 65 73 | 6f 75 72 63 65 28 27 44 | Get1Res|ource('D|
|000047d0| 49 54 4c 27 2c 20 72 65 | 73 49 44 29 3b 0d 09 69 |ITL', re|sID);..i|
|000047e0| 66 20 28 68 29 0d 09 7b | 09 41 70 70 65 6e 64 44 |f (h)..{|.AppendD|
|000047f0| 49 54 4c 28 64 6c 67 2d | 3e 64 69 61 6c 6f 67 2c |ITL(dlg-|>dialog,|
|00004800| 20 68 2c 20 6f 76 65 72 | 6c 61 79 44 49 54 4c 29 | h, over|layDITL)|
|00004810| 3b 0d 09 09 52 65 6c 65 | 61 73 65 52 65 73 6f 75 |;...Rele|aseResou|
|00004820| 72 63 65 28 68 29 3b 0d | 09 7d 0d 7d 0d 0d 0d 0d |rce(h);.|.}.}....|
|00004830| 76 6f 69 64 20 4d 79 53 | 68 6f 72 74 65 6e 44 49 |void MyS|hortenDI|
|00004840| 54 4c 28 44 69 61 6c 6f | 67 44 61 74 61 2a 20 64 |TL(Dialo|gData* d|
|00004850| 6c 67 2c 20 73 68 6f 72 | 74 20 6e 72 49 74 65 6d |lg, shor|t nrItem|
|00004860| 73 29 0d 09 2f 2f 20 72 | 65 6d 6f 76 65 73 20 61 |s)..// r|emoves a|
|00004870| 20 67 69 76 65 6e 20 6e | 75 6d 62 65 72 20 6f 66 | given n|umber of|
|00004880| 20 69 74 65 6d 73 20 66 | 72 6f 6d 20 64 6c 67 0d | items f|rom dlg.|
|00004890| 7b 0d 09 73 68 6f 72 74 | 09 69 3b 0d 09 73 68 6f |{..short|.i;..sho|
|000048a0| 72 74 09 6e 72 49 74 65 | 6d 73 4e 6f 77 20 3d 20 |rt.nrIte|msNow = |
|000048b0| 43 6f 75 6e 74 44 49 54 | 4c 28 64 6c 67 2d 3e 64 |CountDIT|L(dlg->d|
|000048c0| 69 61 6c 6f 67 29 3b 0d | 09 69 66 20 28 6e 72 49 |ialog);.|.if (nrI|
|000048d0| 74 65 6d 73 20 3c 3d 20 | 30 29 20 72 65 74 75 72 |tems <= |0) retur|
|000048e0| 6e 3b 0d 0d 09 66 6f 72 | 20 28 69 3d 6e 72 49 74 |n;...for| (i=nrIt|
|000048f0| 65 6d 73 4e 6f 77 2d 6e | 72 49 74 65 6d 73 3b 20 |emsNow-n|rItems; |
|00004900| 69 3c 3d 6e 72 49 74 65 | 6d 73 4e 6f 77 3b 20 69 |i<=nrIte|msNow; i|
|00004910| 2b 2b 29 0d 09 09 44 69 | 73 70 6f 73 65 4f 6e 65 |++)...Di|sposeOne|
|00004920| 49 74 65 6d 28 64 6c 67 | 2c 20 69 29 3b 0d 0d 09 |Item(dlg|, i);...|
|00004930| 53 68 6f 72 74 65 6e 44 | 49 54 4c 28 64 6c 67 2d |ShortenD|ITL(dlg-|
|00004940| 3e 64 69 61 6c 6f 67 2c | 20 6e 72 49 74 65 6d 73 |>dialog,| nrItems|
|00004950| 29 3b 0d 7d 0d 0d 23 70 | 72 61 67 6d 61 20 6d 61 |);.}..#p|ragma ma|
|00004960| 72 6b 20 2d 0d 0d 76 6f | 69 64 20 4d 79 53 68 6f |rk -..vo|id MySho|
|00004970| 77 44 69 61 6c 6f 67 28 | 44 69 61 6c 6f 67 44 61 |wDialog(|DialogDa|
|00004980| 74 61 2a 20 64 6c 67 29 | 0d 09 2f 2f 20 6d 61 6b |ta* dlg)|..// mak|
|00004990| 65 73 20 74 68 65 20 64 | 69 61 6c 6f 67 20 76 69 |es the d|ialog vi|
|000049a0| 73 69 62 6c 65 0d 7b 0d | 09 53 68 6f 77 57 69 6e |sible.{.|.ShowWin|
|000049b0| 64 6f 77 28 64 6c 67 2d | 3e 64 69 61 6c 6f 67 29 |dow(dlg-|>dialog)|
|000049c0| 3b 0d 09 53 65 6c 65 63 | 74 57 69 6e 64 6f 77 28 |;..Selec|tWindow(|
|000049d0| 64 6c 67 2d 3e 64 69 61 | 6c 6f 67 29 3b 09 09 09 |dlg->dia|log);...|
|000049e0| 09 09 09 09 2f 2f 20 6d | 61 6b 65 20 73 75 72 65 |....// m|ake sure|
|000049f0| 20 69 74 20 69 73 20 69 | 6e 20 66 72 6f 6e 74 2c | it is i|n front,|
|00004a00| 20 6f 6e 65 20 6e 65 76 | 65 72 20 6b 6e 6f 77 73 | one nev|er knows|
|00004a10| 20 77 68 65 6e 20 74 68 | 65 20 73 74 61 74 75 73 | when th|e status|
|00004a20| 20 77 69 6e 64 6f 77 20 | 63 6f 6d 65 73 20 75 70 | window |comes up|
|00004a30| 0d 09 49 6e 69 74 43 75 | 72 73 6f 72 28 29 3b 0d |..InitCu|rsor();.|
|00004a40| 7d 0d 0d 0d 76 6f 69 64 | 20 4d 79 44 69 73 70 6f |}...void| MyDispo|
|00004a50| 73 65 44 69 61 6c 6f 67 | 28 44 69 61 6c 6f 67 44 |seDialog|(DialogD|
|00004a60| 61 74 61 2a 20 64 6c 67 | 29 0d 09 2f 2f 20 63 61 |ata* dlg|)..// ca|
|00004a70| 6c 6c 20 69 6e 73 74 65 | 61 64 20 6f 66 20 44 69 |ll inste|ad of Di|
|00004a80| 73 70 6f 73 65 44 69 61 | 6c 6f 67 0d 09 2f 2f 20 |sposeDia|log..// |
|00004a90| 64 6c 67 3a 20 74 68 65 | 20 64 61 74 61 20 72 65 |dlg: the| data re|
|00004aa0| 74 75 72 6e 65 64 20 62 | 79 20 4d 79 47 65 74 4e |turned b|y MyGetN|
|00004ab0| 65 77 44 69 61 6c 6f 67 | 0d 7b 0d 09 69 6e 74 09 |ewDialog|.{..int.|
|00004ac0| 69 3b 0d 09 69 66 20 28 | 64 6c 67 20 21 3d 20 6e |i;..if (|dlg != n|
|00004ad0| 69 6c 29 0d 09 7b 0d 09 | 09 55 6e 72 65 67 69 73 |il)..{..|.Unregis|
|00004ae0| 74 65 72 57 69 6e 64 6f | 77 28 64 6c 67 2d 3e 64 |terWindo|w(dlg->d|
|00004af0| 69 61 6c 6f 67 29 3b 09 | 09 09 09 09 09 09 2f 2f |ialog);.|......//|
|00004b00| 20 72 65 6d 6f 76 65 20 | 64 69 61 6c 6f 67 20 66 | remove |dialog f|
|00004b10| 72 6f 6d 20 6f 75 72 20 | 77 69 6e 64 6f 77 20 6c |rom our |window l|
|00004b20| 69 73 74 0d 09 09 69 66 | 20 28 64 6c 67 2d 3e 64 |ist...if| (dlg->d|
|00004b30| 69 61 6c 6f 67 29 20 44 | 69 73 70 6f 73 65 44 69 |ialog) D|isposeDi|
|00004b40| 61 6c 6f 67 28 64 6c 67 | 2d 3e 64 69 61 6c 6f 67 |alog(dlg|->dialog|
|00004b50| 29 3b 0d 0d 09 09 66 6f | 72 20 28 69 3d 30 3b 20 |);....fo|r (i=0; |
|00004b60| 69 3c 6d 61 78 4e 72 49 | 74 65 6d 73 3b 20 69 2b |i<maxNrI|tems; i+|
|00004b70| 2b 29 0d 09 09 09 44 69 | 73 70 6f 73 65 4f 6e 65 |+)....Di|sposeOne|
|00004b80| 49 74 65 6d 28 64 6c 67 | 2c 20 69 29 3b 0d 0d 09 |Item(dlg|, i);...|
|00004b90| 09 44 69 73 70 6f 73 65 | 50 74 72 28 28 50 74 72 |.Dispose|Ptr((Ptr|
|00004ba0| 29 64 6c 67 29 3b 0d 09 | 09 41 63 74 69 76 61 74 |)dlg);..|.Activat|
|00004bb0| 65 50 72 6f 46 69 74 57 | 69 6e 64 6f 77 73 28 29 |eProFitW|indows()|
|00004bc0| 3b 0d 09 7d 2f 2f 69 66 | 0d 7d 0d 0d 73 74 61 74 |;..}//if|.}..stat|
|00004bd0| 69 63 20 76 6f 69 64 20 | 4d 61 6b 65 4f 4b 42 6f |ic void |MakeOKBo|
|00004be0| 6c 64 28 44 69 61 6c 6f | 67 44 61 74 61 2a 20 64 |ld(Dialo|gData* d|
|00004bf0| 6c 67 29 0d 7b 0d 09 69 | 66 20 28 64 6c 67 2d 3e |lg).{..i|f (dlg->|
|00004c00| 6f 6b 49 74 65 6d 20 21 | 3d 20 30 29 09 09 09 09 |okItem !|= 0)....|
|00004c10| 09 09 09 09 09 2f 2f 20 | 69 66 20 77 65 20 73 68 |.....// |if we sh|
|00004c20| 6f 75 6c 64 20 6d 61 6b | 65 20 4f 4b 20 62 6f 6c |ould mak|e OK bol|
|00004c30| 64 0d 09 7b 0d 09 09 52 | 65 63 74 09 72 20 3d 20 |d..{...R|ect.r = |
|00004c40| 4d 79 47 65 74 49 74 65 | 6d 52 65 63 74 28 64 6c |MyGetIte|mRect(dl|
|00004c50| 67 2c 20 64 6c 67 2d 3e | 6f 6b 49 74 65 6d 29 3b |g, dlg->|okItem);|
|00004c60| 0d 09 09 73 74 61 74 69 | 63 20 63 6f 6e 73 74 20 |...stati|c const |
|00004c70| 52 47 42 43 6f 6c 6f 72 | 20 67 72 61 79 43 6f 6c |RGBColor| grayCol|
|00004c80| 6f 72 20 3d 20 7b 30 78 | 37 46 46 46 2c 20 30 78 |or = {0x|7FFF, 0x|
|00004c90| 37 46 46 46 2c 20 30 78 | 37 46 46 46 7d 3b 0d 09 |7FFF, 0x|7FFF};..|
|00004ca0| 09 50 65 6e 4e 6f 72 6d | 61 6c 28 29 3b 0d 09 09 |.PenNorm|al();...|
|00004cb0| 69 66 20 28 28 28 57 69 | 6e 64 6f 77 50 65 65 6b |if (((Wi|ndowPeek|
|00004cc0| 29 64 6c 67 2d 3e 64 69 | 61 6c 6f 67 29 2d 3e 68 |)dlg->di|alog)->h|
|00004cd0| 69 6c 69 74 65 64 20 3d | 3d 20 30 29 09 09 2f 2f |ilited =|= 0)..//|
|00004ce0| 20 69 66 20 77 65 20 61 | 72 65 20 6e 6f 74 20 69 | if we a|re not i|
|00004cf0| 6e 20 66 6f 72 65 67 72 | 6f 75 6e 64 0d 09 09 09 |n foregr|ound....|
|00004d00| 52 47 42 46 6f 72 65 43 | 6f 6c 6f 72 28 26 67 72 |RGBForeC|olor(&gr|
|00004d10| 61 79 43 6f 6c 6f 72 29 | 3b 0d 09 09 50 65 6e 53 |ayColor)|;...PenS|
|00004d20| 69 7a 65 28 33 2c 20 33 | 29 3b 0d 09 09 49 6e 73 |ize(3, 3|);...Ins|
|00004d30| 65 74 52 65 63 74 28 26 | 72 2c 20 2d 34 2c 20 2d |etRect(&|r, -4, -|
|00004d40| 34 29 3b 0d 09 09 46 72 | 61 6d 65 52 6f 75 6e 64 |4);...Fr|ameRound|
|00004d50| 52 65 63 74 28 26 72 2c | 20 31 36 2c 20 31 36 29 |Rect(&r,| 16, 16)|
|00004d60| 3b 0d 09 09 50 65 6e 4e | 6f 72 6d 61 6c 28 29 3b |;...PenN|ormal();|
|00004d70| 20 46 6f 72 65 43 6f 6c | 6f 72 28 62 6c 61 63 6b | ForeCol|or(black|
|00004d80| 43 6f 6c 6f 72 29 3b 0d | 09 7d 0d 7d 0d 0d 0d 73 |Color);.|.}.}...s|
|00004d90| 74 61 74 69 63 20 42 6f | 6f 6c 65 61 6e 20 4d 79 |tatic Bo|olean My|
|00004da0| 44 69 61 6c 6f 67 48 61 | 6e 64 6c 65 72 28 6c 6f |DialogHa|ndler(lo|
|00004db0| 6e 67 20 6d 65 73 73 61 | 67 65 2c 20 76 6f 69 64 |ng messa|ge, void|
|00004dc0| 2a 20 6d 2c 20 76 6f 69 | 64 2a 20 70 61 72 61 6d |* m, voi|d* param|
|00004dd0| 29 0d 09 2f 2f 20 61 6e | 20 65 76 65 6e 74 20 68 |)..// an| event h|
|00004de0| 61 6e 64 6c 65 72 20 66 | 6f 72 20 6f 75 72 20 64 |andler f|or our d|
|00004df0| 69 61 6c 6f 67 73 0d 7b | 0d 09 44 69 61 6c 6f 67 |ialogs.{|..Dialog|
|00004e00| 44 61 74 61 2a 09 64 6c | 67 20 3d 20 28 44 69 61 |Data*.dl|g = (Dia|
|00004e10| 6c 6f 67 44 61 74 61 2a | 29 70 61 72 61 6d 3b 0d |logData*|)param;.|
|00004e20| 09 57 69 6e 64 6f 77 50 | 74 72 09 64 69 61 6c 6f |.WindowP|tr.dialo|
|00004e30| 67 20 3d 20 64 6c 67 2d | 3e 64 69 61 6c 6f 67 3b |g = dlg-|>dialog;|
|00004e40| 0d 09 42 6f 6f 6c 65 61 | 6e 09 09 72 65 74 76 61 |..Boolea|n..retva|
|00004e50| 6c 20 3d 20 66 61 6c 73 | 65 3b 0d 09 45 76 65 6e |l = fals|e;..Even|
|00004e60| 74 52 65 63 6f 72 64 2a | 09 65 76 65 6e 74 20 3d |tRecord*|.event =|
|00004e70| 20 28 45 76 65 6e 74 52 | 65 63 6f 72 64 2a 29 6d | (EventR|ecord*)m|
|00004e80| 3b 0d 09 47 72 61 66 50 | 74 72 09 6f 6c 64 50 6f |;..GrafP|tr.oldPo|
|00004e90| 72 74 3b 0d 09 47 65 74 | 50 6f 72 74 28 26 6f 6c |rt;..Get|Port(&ol|
|00004ea0| 64 50 6f 72 74 29 3b 0d | 09 53 65 74 50 6f 72 74 |dPort);.|.SetPort|
|00004eb0| 28 64 69 61 6c 6f 67 29 | 3b 0d 0d 09 69 66 20 28 |(dialog)|;...if (|
|00004ec0| 6d 65 73 73 61 67 65 20 | 21 3d 20 27 65 76 6e 74 |message |!= 'evnt|
|00004ed0| 27 29 20 72 65 74 75 72 | 6e 20 66 61 6c 73 65 3b |') retur|n false;|
|00004ee0| 09 09 09 2f 2f 20 63 61 | 6e 20 6f 6e 6c 79 20 68 |...// ca|n only h|
|00004ef0| 61 6e 64 6c 65 20 65 76 | 65 6e 74 20 6d 65 73 73 |andle ev|ent mess|
|00004f00| 61 67 65 0d 0d 09 69 66 | 20 28 65 76 65 6e 74 2d |age...if| (event-|
|00004f10| 3e 77 68 61 74 20 3d 3d | 20 75 70 64 61 74 65 45 |>what ==| updateE|
|00004f20| 76 74 29 0d 09 7b 0d 09 | 09 73 68 6f 72 74 09 69 |vt)..{..|.short.i|
|00004f30| 3b 0d 0d 09 09 42 65 67 | 69 6e 55 70 64 61 74 65 |;....Beg|inUpdate|
|00004f40| 28 64 69 61 6c 6f 67 29 | 3b 0d 09 09 50 65 6e 4e |(dialog)|;...PenN|
|00004f50| 6f 72 6d 61 6c 28 29 3b | 0d 09 09 66 6f 72 20 28 |ormal();|...for (|
|00004f60| 69 3d 30 3b 20 69 3c 34 | 3b 20 69 2b 2b 29 0d 09 |i=0; i<4|; i++)..|
|00004f70| 09 09 69 66 20 28 64 6c | 67 2d 3e 66 72 61 6d 65 |..if (dl|g->frame|
|00004f80| 73 5b 69 5d 2e 72 69 67 | 68 74 29 0d 09 09 09 09 |s[i].rig|ht).....|
|00004f90| 46 72 61 6d 65 52 65 63 | 74 28 26 64 6c 67 2d 3e |FrameRec|t(&dlg->|
|00004fa0| 66 72 61 6d 65 73 5b 69 | 5d 29 3b 0d 09 09 55 70 |frames[i|]);...Up|
|00004fb0| 64 61 74 65 44 69 61 6c | 6f 67 28 64 69 61 6c 6f |dateDial|og(dialo|
|00004fc0| 67 2c 20 64 69 61 6c 6f | 67 2d 3e 76 69 73 52 67 |g, dialo|g->visRg|
|00004fd0| 6e 29 3b 0d 09 09 4d 61 | 6b 65 4f 4b 42 6f 6c 64 |n);...Ma|keOKBold|
|00004fe0| 28 64 6c 67 29 3b 0d 09 | 09 45 6e 64 55 70 64 61 |(dlg);..|.EndUpda|
|00004ff0| 74 65 28 64 69 61 6c 6f | 67 29 3b 0d 09 7d 2f 2f |te(dialo|g);..}//|
|00005000| 69 66 20 75 70 64 61 74 | 65 45 76 74 0d 09 65 6c |if updat|eEvt..el|
|00005010| 73 65 20 69 66 20 28 65 | 76 65 6e 74 2d 3e 77 68 |se if (e|vent->wh|
|00005020| 61 74 20 3d 3d 20 6b 65 | 79 44 6f 77 6e 29 0d 09 |at == ke|yDown)..|
|00005030| 7b 09 75 6e 73 69 67 6e | 65 64 20 63 68 61 72 20 |{.unsign|ed char |
|00005040| 74 68 65 43 68 61 72 20 | 3d 20 65 76 65 6e 74 2d |theChar |= event-|
|00005050| 3e 6d 65 73 73 61 67 65 | 20 26 20 63 68 61 72 43 |>message| & charC|
|00005060| 6f 64 65 4d 61 73 6b 3b | 0d 09 09 69 66 20 28 64 |odeMask;|...if (d|
|00005070| 6c 67 2d 3e 63 61 6e 63 | 65 6c 49 74 65 6d 20 26 |lg->canc|elItem &|
|00005080| 26 20 43 61 6e 63 65 6c | 45 76 65 6e 74 28 65 76 |& Cancel|Event(ev|
|00005090| 65 6e 74 29 29 09 09 09 | 09 2f 2f 20 69 66 20 63 |ent))...|.// if c|
|000050a0| 61 6e 63 65 6c 0d 09 09 | 7b 09 46 6c 61 73 68 42 |ancel...|{.FlashB|
|000050b0| 75 74 74 6f 6e 28 64 6c | 67 2c 20 64 6c 67 2d 3e |utton(dl|g, dlg->|
|000050c0| 63 61 6e 63 65 6c 49 74 | 65 6d 29 3b 0d 09 09 09 |cancelIt|em);....|
|000050d0| 64 6c 67 2d 3e 69 74 65 | 6d 48 69 74 20 3d 20 64 |dlg->ite|mHit = d|
|000050e0| 6c 67 2d 3e 63 61 6e 63 | 65 6c 49 74 65 6d 3b 0d |lg->canc|elItem;.|
|000050f0| 09 09 09 72 65 74 76 61 | 6c 20 3d 20 74 72 75 65 |...retva|l = true|
|00005100| 3b 0d 09 09 7d 0d 09 09 | 65 6c 73 65 20 69 66 20 |;...}...|else if |
|00005110| 28 64 6c 67 2d 3e 6f 6b | 49 74 65 6d 20 26 26 20 |(dlg->ok|Item && |
|00005120| 28 74 68 65 43 68 61 72 | 3d 3d 33 20 7c 7c 20 74 |(theChar|==3 || t|
|00005130| 68 65 43 68 61 72 3d 3d | 31 33 29 29 09 2f 2f 20 |heChar==|13)).// |
|00005140| 69 66 20 4f 4b 0d 09 09 | 7b 09 46 6c 61 73 68 42 |if OK...|{.FlashB|
|00005150| 75 74 74 6f 6e 28 64 6c | 67 2c 20 64 6c 67 2d 3e |utton(dl|g, dlg->|
|00005160| 6f 6b 49 74 65 6d 29 3b | 0d 09 09 09 64 6c 67 2d |okItem);|....dlg-|
|00005170| 3e 69 74 65 6d 48 69 74 | 20 3d 20 64 6c 67 2d 3e |>itemHit| = dlg->|
|00005180| 6f 6b 49 74 65 6d 3b 0d | 09 09 09 72 65 74 76 61 |okItem;.|...retva|
|00005190| 6c 20 3d 20 74 72 75 65 | 3b 0d 09 09 7d 0d 09 09 |l = true|;...}...|
|000051a0| 65 6c 73 65 20 72 65 74 | 76 61 6c 20 3d 20 44 69 |else ret|val = Di|
|000051b0| 61 6c 6f 67 53 65 6c 65 | 63 74 28 65 76 65 6e 74 |alogSele|ct(event|
|000051c0| 2c 20 26 64 69 61 6c 6f | 67 2c 20 26 64 6c 67 2d |, &dialo|g, &dlg-|
|000051d0| 3e 69 74 65 6d 48 69 74 | 29 3b 0d 09 7d 0d 09 65 |>itemHit|);..}..e|
|000051e0| 6c 73 65 20 69 66 20 28 | 65 76 65 6e 74 2d 3e 77 |lse if (|event->w|
|000051f0| 68 61 74 20 3d 3d 20 61 | 63 74 69 76 61 74 65 45 |hat == a|ctivateE|
|00005200| 76 74 29 0d 09 7b 09 72 | 65 74 76 61 6c 20 3d 20 |vt)..{.r|etval = |
|00005210| 44 69 61 6c 6f 67 53 65 | 6c 65 63 74 28 65 76 65 |DialogSe|lect(eve|
|00005220| 6e 74 2c 20 26 64 69 61 | 6c 6f 67 2c 20 26 64 6c |nt, &dia|log, &dl|
|00005230| 67 2d 3e 69 74 65 6d 48 | 69 74 29 3b 0d 09 09 4d |g->itemH|it);...M|
|00005240| 61 6b 65 4f 4b 42 6f 6c | 64 28 64 6c 67 29 3b 09 |akeOKBol|d(dlg);.|
|00005250| 09 09 09 09 09 09 09 2f | 2f 20 66 72 61 6d 65 20 |......./|/ frame |
|00005260| 69 74 20 69 6e 20 67 72 | 61 79 20 6f 72 20 62 6c |it in gr|ay or bl|
|00005270| 61 63 6b 0d 09 7d 0d 09 | 65 6c 73 65 20 69 66 20 |ack..}..|else if |
|00005280| 28 65 76 65 6e 74 2d 3e | 77 68 61 74 20 3d 3d 20 |(event->|what == |
|00005290| 6e 75 6c 6c 45 76 65 6e | 74 20 26 26 20 64 6c 67 |nullEven|t && dlg|
|000052a0| 2d 3e 74 69 6d 65 72 20 | 26 26 20 64 6c 67 2d 3e |->timer |&& dlg->|
|000052b0| 74 69 6d 65 72 20 3c 20 | 54 69 63 6b 43 6f 75 6e |timer < |TickCoun|
|000052c0| 74 28 29 29 0d 09 7b 09 | 64 6c 67 2d 3e 69 74 65 |t())..{.|dlg->ite|
|000052d0| 6d 48 69 74 20 3d 20 2d | 31 3b 0d 09 09 64 6c 67 |mHit = -|1;...dlg|
|000052e0| 2d 3e 74 69 6d 65 72 20 | 3d 20 30 3b 0d 09 09 72 |->timer |= 0;...r|
|000052f0| 65 74 76 61 6c 20 3d 20 | 74 72 75 65 3b 0d 09 7d |etval = |true;..}|
|00005300| 0d 09 65 6c 73 65 20 72 | 65 74 76 61 6c 20 3d 20 |..else r|etval = |
|00005310| 44 69 61 6c 6f 67 53 65 | 6c 65 63 74 28 65 76 65 |DialogSe|lect(eve|
|00005320| 6e 74 2c 20 26 64 69 61 | 6c 6f 67 2c 20 26 64 6c |nt, &dia|log, &dl|
|00005330| 67 2d 3e 69 74 65 6d 48 | 69 74 29 3b 0d 0d 09 53 |g->itemH|it);...S|
|00005340| 65 74 50 6f 72 74 28 6f | 6c 64 50 6f 72 74 29 3b |etPort(o|ldPort);|
|00005350| 0d 09 72 65 74 75 72 6e | 20 72 65 74 76 61 6c 3b |..return| retval;|
|00005360| 0d 7d 0d 0d 0d 44 69 61 | 6c 6f 67 44 61 74 61 2a |.}...Dia|logData*|
|00005370| 20 4d 79 47 65 74 4e 65 | 77 44 69 61 6c 6f 67 28 | MyGetNe|wDialog(|
|00005380| 73 68 6f 72 74 20 72 65 | 73 49 44 2c 20 73 68 6f |short re|sID, sho|
|00005390| 72 74 20 6f 6b 49 74 65 | 6d 2c 20 73 68 6f 72 74 |rt okIte|m, short|
|000053a0| 20 63 61 6e 63 65 6c 49 | 74 65 6d 29 0d 09 2f 2f | cancelI|tem)..//|
|000053b0| 20 63 61 6c 6c 20 69 6e | 73 74 65 61 64 20 6f 66 | call in|stead of|
|000053c0| 20 47 65 74 4e 65 77 44 | 69 61 6c 6f 67 0d 09 2f | GetNewD|ialog../|
|000053d0| 2f 20 72 65 73 49 44 3a | 09 09 74 68 65 20 72 65 |/ resID:|..the re|
|000053e0| 73 6f 75 72 63 65 20 49 | 44 20 6f 66 20 74 68 65 |source I|D of the|
|000053f0| 20 44 4c 4f 47 0d 09 2f | 2f 20 6f 6b 49 74 65 6d | DLOG../|/ okItem|
|00005400| 3a 09 09 74 68 65 20 69 | 74 65 6d 20 74 6f 20 62 |:..the i|tem to b|
|00005410| 65 20 61 63 74 69 76 61 | 74 65 64 20 77 68 65 6e |e activa|ted when|
|00005420| 20 45 6e 74 65 72 2f 52 | 65 74 75 72 6e 20 69 73 | Enter/R|eturn is|
|00005430| 20 70 72 65 73 73 65 64 | 20 28 30 20 69 66 20 6e | pressed| (0 if n|
|00005440| 6f 6e 65 29 0d 09 2f 2f | 20 63 61 6e 63 6c 65 49 |one)..//| cancleI|
|00005450| 74 65 6d 09 74 68 65 20 | 69 74 65 6d 20 74 6f 20 |tem.the |item to |
|00005460| 62 65 20 61 63 74 69 76 | 61 74 65 64 20 77 68 65 |be activ|ated whe|
|00005470| 6e 20 45 73 63 61 70 65 | 2f 63 6d 64 2d 2e 20 69 |n Escape|/cmd-. i|
|00005480| 73 20 70 72 65 73 73 65 | 64 20 28 30 20 69 66 20 |s presse|d (0 if |
|00005490| 6e 6f 6e 65 29 0d 09 2f | 2f 20 72 65 74 75 72 6e |none)../|/ return|
|000054a0| 73 20 6e 69 6c 20 69 66 | 20 66 61 69 6c 75 72 65 |s nil if| failure|
|000054b0| 0d 7b 0d 09 44 69 61 6c | 6f 67 50 74 72 09 09 64 |.{..Dial|ogPtr..d|
|000054c0| 69 61 6c 6f 67 3b 0d 09 | 44 69 61 6c 6f 67 44 61 |ialog;..|DialogDa|
|000054d0| 74 61 2a 09 09 64 6c 67 | 3d 6e 69 6c 3b 0d 09 4d |ta*..dlg|=nil;..M|
|000054e0| 6f 64 61 6c 46 69 6c 74 | 65 72 55 50 50 09 73 74 |odalFilt|erUPP.st|
|000054f0| 64 46 69 6c 74 65 72 3d | 6e 69 6c 3b 0d 09 0d 09 |dFilter=|nil;....|
|00005500| 64 6c 67 20 3d 20 28 44 | 69 61 6c 6f 67 44 61 74 |dlg = (D|ialogDat|
|00005510| 61 2a 29 4e 65 77 50 74 | 72 43 6c 65 61 72 28 73 |a*)NewPt|rClear(s|
|00005520| 69 7a 65 6f 66 28 44 69 | 61 6c 6f 67 44 61 74 61 |izeof(Di|alogData|
|00005530| 29 29 3b 0d 09 69 66 20 | 28 64 6c 67 20 3d 3d 20 |));..if |(dlg == |
|00005540| 6e 69 6c 29 20 67 6f 74 | 6f 20 66 61 69 6c 3b 0d |nil) got|o fail;.|
|00005550| 0d 09 64 69 61 6c 6f 67 | 20 3d 20 47 65 74 4e 65 |..dialog| = GetNe|
|00005560| 77 44 69 61 6c 6f 67 28 | 72 65 73 49 44 2c 20 6e |wDialog(|resID, n|
|00005570| 69 6c 2c 20 28 57 69 6e | 64 6f 77 50 74 72 29 28 |il, (Win|dowPtr)(|
|00005580| 2d 31 29 29 3b 0d 09 69 | 66 20 28 64 69 61 6c 6f |-1));..i|f (dialo|
|00005590| 67 20 3d 3d 20 6e 69 6c | 29 20 67 6f 74 6f 20 66 |g == nil|) goto f|
|000055a0| 61 69 6c 3b 0d 0d 09 64 | 6c 67 2d 3e 6f 6b 49 74 |ail;...d|lg->okIt|
|000055b0| 65 6d 20 3d 20 6f 6b 49 | 74 65 6d 3b 0d 09 64 6c |em = okI|tem;..dl|
|000055c0| 67 2d 3e 63 61 6e 63 65 | 6c 49 74 65 6d 20 3d 20 |g->cance|lItem = |
|000055d0| 63 61 6e 63 65 6c 49 74 | 65 6d 3b 0d 09 64 6c 67 |cancelIt|em;..dlg|
|000055e0| 2d 3e 64 69 61 6c 6f 67 | 20 3d 20 64 69 61 6c 6f |->dialog| = dialo|
|000055f0| 67 3b 0d 09 53 65 74 57 | 52 65 66 43 6f 6e 28 64 |g;..SetW|RefCon(d|
|00005600| 69 61 6c 6f 67 2c 20 28 | 6c 6f 6e 67 29 64 6c 67 |ialog, (|long)dlg|
|00005610| 29 3b 0d 0d 09 43 65 6e | 74 65 72 57 69 6e 64 6f |);...Cen|terWindo|
|00005620| 77 28 64 69 61 6c 6f 67 | 29 3b 0d 09 52 65 67 69 |w(dialog|);..Regi|
|00005630| 73 74 65 72 57 69 6e 64 | 6f 77 28 64 69 61 6c 6f |sterWind|ow(dialo|
|00005640| 67 2c 20 26 4d 79 44 69 | 61 6c 6f 67 48 61 6e 64 |g, &MyDi|alogHand|
|00005650| 6c 65 72 2c 20 64 6c 67 | 29 3b 09 09 09 2f 2f 20 |ler, dlg|);...// |
|00005660| 72 65 67 69 73 74 65 72 | 20 61 6e 64 20 70 6f 73 |register| and pos|
|00005670| 69 74 69 6f 6e 20 69 74 | 0d 09 44 65 61 63 74 69 |ition it|..Deacti|
|00005680| 76 61 74 65 50 72 6f 46 | 69 74 57 69 6e 64 6f 77 |vateProF|itWindow|
|00005690| 73 28 29 3b 09 09 09 09 | 09 09 09 09 2f 2f 20 74 |s();....|....// t|
|000056a0| 68 69 73 20 70 72 65 76 | 65 6e 74 73 20 74 68 65 |his prev|ents the|
|000056b0| 20 73 74 61 74 75 73 20 | 77 69 6e 64 6f 77 20 66 | status |window f|
|000056c0| 72 6f 6d 20 63 6f 6d 69 | 6e 67 20 0d 0d 09 72 65 |rom comi|ng ...re|
|000056d0| 74 75 72 6e 20 64 6c 67 | 3b 0d 0d 66 61 69 6c 3a |turn dlg|;..fail:|
|000056e0| 0d 09 4d 79 44 69 73 70 | 6f 73 65 44 69 61 6c 6f |..MyDisp|oseDialo|
|000056f0| 67 28 64 6c 67 29 3b 0d | 09 72 65 74 75 72 6e 20 |g(dlg);.|.return |
|00005700| 6e 69 6c 3b 0d 7d 0d 0d | 0d 0d 76 6f 69 64 20 4d |nil;.}..|..void M|
|00005710| 79 4d 6f 64 61 6c 44 69 | 61 6c 6f 67 28 44 69 61 |yModalDi|alog(Dia|
|00005720| 6c 6f 67 44 61 74 61 2a | 20 64 6c 67 2c 20 73 68 |logData*| dlg, sh|
|00005730| 6f 72 74 2a 20 63 6f 6e | 73 74 20 69 74 65 6d 48 |ort* con|st itemH|
|00005740| 69 74 29 0d 09 2f 2f 20 | 63 61 6c 6c 20 69 6e 73 |it)..// |call ins|
|00005750| 74 65 61 64 20 6f 66 20 | 4d 6f 64 61 6c 44 69 61 |tead of |ModalDia|
|00005760| 6c 6f 67 0d 09 2f 2f 20 | 64 6c 67 3a 20 74 68 65 |log..// |dlg: the|
|00005770| 20 64 61 74 61 20 72 65 | 74 75 72 6e 65 64 20 62 | data re|turned b|
|00005780| 79 20 4d 79 47 65 74 4e | 65 77 44 69 61 6c 6f 67 |y MyGetN|ewDialog|
|00005790| 0d 09 2f 2f 20 41 75 74 | 6f 6d 61 74 69 63 61 6c |..// Aut|omatical|
|000057a0| 6c 79 20 74 6f 67 67 6c | 65 73 20 63 68 65 63 6b |ly toggl|es check|
|000057b0| 62 6f 78 65 73 20 77 68 | 65 6e 20 63 6c 69 63 6b |boxes wh|en click|
|000057c0| 65 64 0d 7b 0d 09 73 68 | 6f 72 74 09 09 69 74 3b |ed.{..sh|ort..it;|
|000057d0| 0d 09 49 74 65 6d 54 79 | 70 65 09 74 79 70 65 3b |..ItemTy|pe.type;|
|000057e0| 0d 09 73 68 6f 72 74 09 | 09 6b 69 6e 64 3b 0d 0d |..short.|.kind;..|
|000057f0| 09 64 6c 67 2d 3e 69 74 | 65 6d 48 69 74 20 3d 20 |.dlg->it|emHit = |
|00005800| 30 3b 0d 0d 09 64 6f 20 | 45 76 65 6e 74 4c 6f 6f |0;...do |EventLoo|
|00005810| 70 28 29 3b 20 77 68 69 | 6c 65 20 28 64 6c 67 2d |p(); whi|le (dlg-|
|00005820| 3e 69 74 65 6d 48 69 74 | 20 3d 3d 20 30 29 3b 0d |>itemHit| == 0);.|
|00005830| 0d 09 69 74 20 3d 20 64 | 6c 67 2d 3e 69 74 65 6d |..it = d|lg->item|
|00005840| 48 69 74 3b 0d 09 74 79 | 70 65 20 3d 20 64 6c 67 |Hit;..ty|pe = dlg|
|00005850| 2d 3e 69 74 65 6d 73 5b | 69 74 5d 2e 74 79 70 65 |->items[|it].type|
|00005860| 3b 0d 09 6b 69 6e 64 20 | 3d 20 4d 79 47 65 74 49 |;..kind |= MyGetI|
|00005870| 74 65 6d 4b 69 6e 64 28 | 64 6c 67 2c 20 69 74 29 |temKind(|dlg, it)|
|00005880| 3b 0d 0d 09 69 66 20 28 | 6b 69 6e 64 20 3d 3d 20 |;...if (|kind == |
|00005890| 63 74 72 6c 49 74 65 6d | 2b 63 68 6b 43 74 72 6c |ctrlItem|+chkCtrl|
|000058a0| 29 09 09 09 09 09 09 09 | 09 2f 2f 20 69 66 20 61 |).......|.// if a|
|000058b0| 20 63 68 65 63 6b 62 6f | 78 20 77 61 73 20 63 6c | checkbo|x was cl|
|000058c0| 69 63 6b 65 64 0d 09 09 | 4d 79 53 65 74 49 74 65 |icked...|MySetIte|
|000058d0| 6d 56 61 6c 75 65 28 64 | 6c 67 2c 20 69 74 2c 20 |mValue(d|lg, it, |
|000058e0| 21 4d 79 47 65 74 49 74 | 65 6d 56 61 6c 75 65 28 |!MyGetIt|emValue(|
|000058f0| 64 6c 67 2c 20 69 74 29 | 29 3b 09 09 2f 2f 20 74 |dlg, it)|);..// t|
|00005900| 68 65 6e 20 74 6f 67 67 | 6c 65 20 69 74 0d 09 65 |hen togg|le it..e|
|00005910| 6c 73 65 20 69 66 20 28 | 6b 69 6e 64 20 3d 3d 20 |lse if (|kind == |
|00005920| 63 74 72 6c 49 74 65 6d | 2b 72 61 64 43 74 72 6c |ctrlItem|+radCtrl|
|00005930| 29 09 09 09 09 09 09 09 | 2f 2f 20 69 66 20 61 20 |).......|// if a |
|00005940| 72 61 64 69 6f 0d 09 09 | 4d 79 53 65 74 49 74 65 |radio...|MySetIte|
|00005950| 6d 56 61 6c 75 65 28 64 | 6c 67 2c 20 69 74 2c 20 |mValue(d|lg, it, |
|00005960| 31 29 3b 09 09 09 09 09 | 09 09 09 2f 2f 20 74 68 |1);.....|...// th|
|00005970| 65 6e 20 63 68 65 63 6b | 20 69 74 0d 0d 09 69 66 |en check| it...if|
|00005980| 20 28 74 79 70 65 20 3d | 3d 20 77 69 6e 64 6f 77 | (type =|= window|
|00005990| 50 6f 70 75 70 49 74 65 | 6d 29 09 09 09 09 09 09 |PopupIte|m)......|
|000059a0| 09 09 2f 2f 20 69 66 20 | 61 20 77 69 6e 64 6f 77 |..// if |a window|
|000059b0| 20 70 6f 70 75 70 20 69 | 74 65 6d 20 77 61 73 20 | popup i|tem was |
|000059c0| 63 6c 69 63 6b 65 64 0d | 09 09 55 70 64 61 74 65 |clicked.|..Update|
|000059d0| 43 6f 6c 75 6d 6e 50 6f | 70 75 70 49 74 65 6d 73 |ColumnPo|pupItems|
|000059e0| 28 64 6c 67 2c 20 69 74 | 29 3b 09 09 09 09 09 09 |(dlg, it|);......|
|000059f0| 2f 2f 20 74 68 65 6e 20 | 6d 61 6b 65 20 73 75 72 |// then |make sur|
|00005a00| 65 20 74 68 61 74 20 61 | 6c 6c 20 69 74 73 20 63 |e that a|ll its c|
|00005a10| 6f 6c 75 6d 6e 20 70 6f | 70 75 70 73 20 61 72 65 |olumn po|pups are|
|00005a20| 20 75 70 64 61 74 65 64 | 0d 0d 09 2a 69 74 65 6d | updated|...*item|
|00005a30| 48 69 74 20 3d 20 64 6c | 67 2d 3e 69 74 65 6d 48 |Hit = dl|g->itemH|
|00005a40| 69 74 3b 0d 7d 2f 2f 4d | 79 4d 6f 64 61 6c 44 69 |it;.}//M|yModalDi|
|00005a50| 61 6c 6f 67 0d 0d 23 70 | 72 61 67 6d 61 20 6d 61 |alog..#p|ragma ma|
|00005a60| 72 6b 20 2d 0d 0d 73 68 | 6f 72 74 20 4d 79 50 6f |rk -..sh|ort MyPo|
|00005a70| 73 69 74 69 6f 6e 65 64 | 41 6c 65 72 74 28 73 68 |sitioned|Alert(sh|
|00005a80| 6f 72 74 20 72 65 73 49 | 44 2c 20 52 65 63 74 2a |ort resI|D, Rect*|
|00005a90| 20 63 6f 6e 73 74 20 70 | 6f 73 69 74 69 6f 6e 29 | const p|osition)|
|00005aa0| 0d 09 2f 2f 20 73 68 6f | 77 73 20 61 20 67 69 76 |..// sho|ws a giv|
|00005ab0| 65 6e 20 61 6c 65 72 74 | 20 62 6f 78 2c 20 72 65 |en alert| box, re|
|00005ac0| 74 75 72 6e 73 20 74 68 | 65 20 63 6c 69 63 6b 65 |turns th|e clicke|
|00005ad0| 64 20 69 74 65 6d 0d 09 | 2f 2f 20 72 65 73 49 44 |d item..|// resID|
|00005ae0| 3a 20 74 68 65 20 72 65 | 73 20 49 44 20 6f 66 20 |: the re|s ID of |
|00005af0| 61 20 44 4c 4f 47 0d 09 | 2f 2f 20 70 6f 73 69 74 |a DLOG..|// posit|
|00005b00| 69 6f 6e 3a 20 6f 6e 20 | 65 6e 74 72 79 3a 09 74 |ion: on |entry:.t|
|00005b10| 68 65 20 70 6f 73 69 74 | 69 6f 6e 20 6f 66 20 74 |he posit|ion of t|
|00005b20| 68 65 20 61 6c 65 72 74 | 20 77 69 6e 64 6f 77 20 |he alert| window |
|00005b30| 69 6e 20 67 6c 6f 62 61 | 6c 20 63 6f 6f 72 64 2e |in globa|l coord.|
|00005b40| 20 6f 72 20 7b 30 2c 30 | 2c 30 2c 30 7d 0d 09 2f | or {0,0|,0,0}../|
|00005b50| 2f 09 09 09 09 09 09 66 | 6f 72 20 64 65 66 61 75 |/......f|or defau|
|00005b60| 6c 74 20 70 6f 73 69 74 | 69 6f 6e 0d 09 2f 2f 09 |lt posit|ion..//.|
|00005b70| 09 09 20 6f 6e 20 65 78 | 69 74 3a 09 74 68 65 20 |.. on ex|it:.the |
|00005b80| 6c 61 73 74 20 70 6f 73 | 69 74 69 6f 6e 20 6f 66 |last pos|ition of|
|00005b90| 20 74 68 65 20 61 6c 65 | 72 74 20 77 69 6e 64 6f | the ale|rt windo|
|00005ba0| 77 0d 7b 0d 09 73 68 6f | 72 74 20 69 74 65 6d 48 |w.{..sho|rt itemH|
|00005bb0| 69 74 3b 0d 09 44 69 61 | 6c 6f 67 44 61 74 61 2a |it;..Dia|logData*|
|00005bc0| 20 64 6c 67 20 3d 20 4d | 79 47 65 74 4e 65 77 44 | dlg = M|yGetNewD|
|00005bd0| 69 61 6c 6f 67 28 72 65 | 73 49 44 2c 20 6f 6b 2c |ialog(re|sID, ok,|
|00005be0| 20 63 61 6e 63 65 6c 29 | 3b 0d 09 69 66 20 28 64 | cancel)|;..if (d|
|00005bf0| 6c 67 3d 3d 6e 69 6c 29 | 20 72 65 74 75 72 6e 20 |lg==nil)| return |
|00005c00| 6f 6b 3b 0d 09 53 65 74 | 47 6c 6f 62 61 6c 57 69 |ok;..Set|GlobalWi|
|00005c10| 6e 64 6f 77 52 65 63 74 | 28 64 6c 67 2d 3e 64 69 |ndowRect|(dlg->di|
|00005c20| 61 6c 6f 67 2c 20 70 6f | 73 69 74 69 6f 6e 29 3b |alog, po|sition);|
|00005c30| 0d 09 4d 79 53 68 6f 77 | 44 69 61 6c 6f 67 28 64 |..MyShow|Dialog(d|
|00005c40| 6c 67 29 3b 0d 09 4d 79 | 4d 6f 64 61 6c 44 69 61 |lg);..My|ModalDia|
|00005c50| 6c 6f 67 28 64 6c 67 2c | 20 26 69 74 65 6d 48 69 |log(dlg,| &itemHi|
|00005c60| 74 29 3b 0d 09 47 65 74 | 47 6c 6f 62 61 6c 57 69 |t);..Get|GlobalWi|
|00005c70| 6e 64 6f 77 52 65 63 74 | 28 64 6c 67 2d 3e 64 69 |ndowRect|(dlg->di|
|00005c80| 61 6c 6f 67 2c 20 70 6f | 73 69 74 69 6f 6e 29 3b |alog, po|sition);|
|00005c90| 0d 09 4d 79 44 69 73 70 | 6f 73 65 44 69 61 6c 6f |..MyDisp|oseDialo|
|00005ca0| 67 28 64 6c 67 29 3b 0d | 09 72 65 74 75 72 6e 20 |g(dlg);.|.return |
|00005cb0| 69 74 65 6d 48 69 74 3b | 0d 7d 0d 0d 73 68 6f 72 |itemHit;|.}..shor|
|00005cc0| 74 20 4d 79 41 6c 65 72 | 74 28 73 68 6f 72 74 20 |t MyAler|t(short |
|00005cd0| 72 65 73 49 44 29 0d 09 | 2f 2f 20 73 68 6f 77 73 |resID)..|// shows|
|00005ce0| 20 61 20 67 69 76 65 6e | 20 61 6c 65 72 74 20 62 | a given| alert b|
|00005cf0| 6f 78 2c 20 72 65 74 75 | 72 6e 73 20 74 68 65 20 |ox, retu|rns the |
|00005d00| 63 6c 69 63 6b 65 64 20 | 69 74 65 6d 0d 09 2f 2f |clicked |item..//|
|00005d10| 20 72 65 73 49 44 3a 20 | 74 68 65 20 72 65 73 20 | resID: |the res |
|00005d20| 49 44 20 6f 66 20 61 20 | 44 4c 4f 47 0d 7b 0d 09 |ID of a |DLOG.{..|
|00005d30| 52 65 63 74 09 75 6e 75 | 73 65 64 50 6f 73 69 74 |Rect.unu|sedPosit|
|00005d40| 69 6f 6e 20 3d 20 7b 30 | 2c 30 2c 30 2c 30 7d 3b |ion = {0|,0,0,0};|
|00005d50| 0d 09 72 65 74 75 72 6e | 20 4d 79 50 6f 73 69 74 |..return| MyPosit|
|00005d60| 69 6f 6e 65 64 41 6c 65 | 72 74 28 72 65 73 49 44 |ionedAle|rt(resID|
|00005d70| 2c 20 26 75 6e 75 73 65 | 64 50 6f 73 69 74 69 6f |, &unuse|dPositio|
|00005d80| 6e 29 3b 0d 7d 0d 00 00 | 00 00 00 00 00 00 00 00 |n);.}...|........|
|00005d90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005da0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005db0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005e00| 00 00 01 00 00 00 01 54 | 00 00 00 54 00 00 00 46 |.......T|...T...F|
|00005e10| 00 00 ff 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005e20| 00 00 00 00 00 00 00 00 | f6 ff 00 00 00 00 00 00 |........|........|
|00005e30| 11 4d 6f 64 75 6c 65 55 | 74 69 6c 69 74 69 65 73 |.ModuleU|tilities|
|00005e40| 2e 63 02 00 00 00 54 45 | 58 54 43 57 49 45 01 00 |.c....TE|XTCWIE..|
|00005e50| 00 00 54 45 58 54 43 57 | 49 45 01 00 00 00 00 00 |..TEXTCW|IE......|
|00005e60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005e70| 00 00 ad 4d 0d 09 00 00 | 5d 06 00 00 01 9a f6 f6 |...M....|].......|
|00005e80| f6 f6 f6 f6 f6 f6 f6 2b | f7 ff 00 00 00 00 00 00 |.......+|........|
|00005e90| 00 00 ff 00 f5 f6 f6 f6 | f6 f6 f6 f6 f6 f6 f6 ff |........|........|
|00005ea0| ff ff f6 ff ff ff f6 2b | f7 ff 00 00 00 00 00 00 |.......+|........|
|00005eb0| 00 00 ff 00 f5 f6 f6 f6 | f6 47 f6 f6 f6 f6 f6 f6 |........|.G......|
|00005ec0| f6 f6 f6 f6 f6 f6 f6 2b | f7 ff 00 00 00 00 00 00 |.......+|........|
|00005ed0| 00 00 ff 00 f5 f6 f6 f6 | 47 47 f6 f6 f6 ff ff f6 |........|GG......|
|00005ee0| ff ff ff f6 ff ff f6 2b | f7 ff 00 00 00 00 00 00 |.......+|........|
|00005ef0| 00 00 ff 00 f5 f6 f6 47 | 47 47 f6 f6 f6 f6 f6 f6 |.......G|GG......|
|00005f00| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00005f10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005f20| 00 00 00 00 00 00 00 03 | 00 04 00 58 00 04 03 61 |........|...X...a|
|00005f30| 02 5e 00 58 00 04 03 61 | 02 5e ae 0d 88 35 00 00 |.^.X...a|.^...5..|
|00005f40| 12 73 00 00 12 7c 00 00 | 0e 78 00 00 00 00 00 04 |.s...|..|.x......|
|00005f50| 00 01 00 01 00 00 01 00 | 00 00 01 54 00 00 00 54 |........|...T...T|
|00005f60| 00 00 00 46 02 96 03 e4 | 31 f2 00 00 00 1c 00 46 |...F....|1......F|
|00005f70| 00 01 4d 50 53 52 00 00 | 00 12 4d 57 42 42 00 00 |..MPSR..|..MWBB..|
|00005f80| 00 1e 03 ed ff ff 00 00 | 00 00 00 00 00 00 03 f0 |........|........|
|00005f90| ff ff 00 00 00 4c 00 00 | 00 00 00 00 00 00 00 00 |.....L..|........|
|00005fa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+